[education/rkward] /: Allow to install package that depend on rkward from dialog

Thomas Friedrichsmeier null at kde.org
Thu Apr 21 16:16:25 BST 2022


Git commit d43e43471739a1021cd1a724e4da65ef37f0cc1d by Thomas Friedrichsmeier.
Committed on 21/04/2022 at 15:16.
Pushed by tfry into branch 'master'.

Allow to install package that depend on rkward from dialog

M  +1    -0    ChangeLog
M  +2    -1    rkward/dialogs/rkloadlibsdialog.cpp
M  +1    -0    rkward/settings/rksettingsmoduler.h

https://invent.kde.org/education/rkward/commit/d43e43471739a1021cd1a724e4da65ef37f0cc1d

diff --git a/ChangeLog b/ChangeLog
index 7d8d96e2..dcc517c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+- Fixed: Installation from dialog would fail for R packages requiring the rkward package
 - Allow separate analysis by grouping factors in Analysis->Descriptive Statistics
 - Rework help start page to serve as a dashboard for common tasks
    - TODO: finish this
diff --git a/rkward/dialogs/rkloadlibsdialog.cpp b/rkward/dialogs/rkloadlibsdialog.cpp
index e6c207fe..c178fcdc 100644
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@ -273,7 +273,8 @@ bool RKLoadLibsDialog::installPackages (const QStringList &packages, QString to_
 
 	addLibraryLocation (to_libloc);
 
-	QString command_string = "install.packages (c (\"" + packages.join ("\", \"") + "\")" + ", lib=" + RObject::rQuote (to_libloc);
+	QString command_string = RKSettingsModuleRPackages::libLocsCommand();
+	command_string += "\ninstall.packages (c (\"" + packages.join ("\", \"") + "\")" + ", lib=" + RObject::rQuote (to_libloc);
 	QString downloaddir = QDir (RKSettingsModuleGeneral::filesPath ()).filePath ("package_archive");
 	if (RKSettingsModuleRPackages::archivePackages ()) {
 		QDir (RKSettingsModuleGeneral::filesPath ()).mkdir ("package_archive");
diff --git a/rkward/settings/rksettingsmoduler.h b/rkward/settings/rksettingsmoduler.h
index b35f769d..15daf547 100644
--- a/rkward/settings/rksettingsmoduler.h
+++ b/rkward/settings/rksettingsmoduler.h
@@ -120,6 +120,7 @@ public slots:
 protected:
 	void rCommandDone (RCommand *command) override;
 private:
+friend class RKLoadLibsDialog;
 	static QString libLocsCommand ();
 
 	MultiStringSelector *libloc_selector;


More information about the rkward-tracker mailing list