From kde-commits Mon May 26 22:38:38 2003 From: Amilcar do Carmo Lucas Date: Mon, 26 May 2003 22:38:38 +0000 To: kde-commits Subject: kdevelop/parts/autoproject X-MARC-Message: https://marc.info/?l=kde-commits&m=105398872626386 CVS commit by aclu: "Install with kdesu" command in "Build" menu can be useful. Patch by: Marcin Dec < ced -at- ciapek.uci.agh.edu.pl > aka "analena" on #kdevelop channel on irc.kde.org M +14 -1 autoprojectpart.cpp 1.91 M +2 -1 autoprojectpart.h 1.31 M +1 -0 kdevautoproject.rc 1.11 --- kdevelop/parts/autoproject/autoprojectpart.cpp #1.90:1.91 @@ -111,4 +111,8 @@ AutoProjectPart::AutoProjectPart(QObject actionCollection(), "build_install" ); + action = new KAction( i18n("Install with kdesu"), 0, + this, SLOT(slotInstallWithKdesu()), + actionCollection(), "build_install_kdesu" ); + action = new KAction( i18n("&Clean Project"), 0, this, SLOT(slotClean()), @@ -448,5 +452,5 @@ QString AutoProjectPart::constructMakeCo -void AutoProjectPart::startMakeCommand(const QString &dir, const QString &target) +void AutoProjectPart::startMakeCommand(const QString &dir, const QString &target, bool withKdesu) { partController()->saveAllFiles(); @@ -454,4 +458,7 @@ void AutoProjectPart::startMakeCommand(c m_buildCommand = constructMakeCommandLine(dir, target); + if (withKdesu) + m_buildCommand = "kdesu -t -c '" + m_buildCommand + "'"; + if (!m_buildCommand.isNull()) makeFrontend()->queueCommand(dir, m_buildCommand); @@ -712,4 +719,10 @@ void AutoProjectPart::slotInstall() { startMakeCommand(buildDirectory(), QString::fromLatin1("install")); +} + + +void AutoProjectPart::slotInstallWithKdesu() +{ + startMakeCommand(buildDirectory(), QString::fromLatin1("install"), true); } --- kdevelop/parts/autoproject/autoprojectpart.h #1.30:1.31 @@ -66,5 +66,5 @@ public: QString currentBuildConfig(); QString topsourceDirectory(); - void startMakeCommand(const QString &dir, const QString &target); + void startMakeCommand(const QString &dir, const QString &target, bool withKdesu = false); void buildTarget(QString relpath, TargetItem* titem); @@ -89,4 +89,5 @@ private slots: void slotDistClean(); void slotInstall(); + void slotInstallWithKdesu(); void slotMakefilecvs(); void slotMakeMessages(); --- kdevelop/parts/autoproject/kdevautoproject.rc #1.10:1.11 @@ -13,4 +13,5 @@ +