diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-04-03 22:53:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-04-03 22:53:41 +0000 |
commit | 01a3b7ad4464682c1d4319151ab7791f6f0a9dd8 (patch) | |
tree | 1e1d6d8845c1693a37ef59d9b1e64bcab7d17cf7 /kdpkg-install/console.cpp | |
parent | 36c0c6f7092be4adf056abf2a63e79dda7f02ede (diff) | |
download | kdpkg-01a3b7ad4464682c1d4319151ab7791f6f0a9dd8.tar.gz kdpkg-01a3b7ad4464682c1d4319151ab7791f6f0a9dd8.zip |
Made program functional again
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdpkg@1110662 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdpkg-install/console.cpp')
-rw-r--r-- | kdpkg-install/console.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/kdpkg-install/console.cpp b/kdpkg-install/console.cpp index cc6f450..f1dfaa9 100644 --- a/kdpkg-install/console.cpp +++ b/kdpkg-install/console.cpp @@ -28,21 +28,51 @@ #include <qwidgetstack.h> #include <qlistview.h> #include <qtextedit.h> +#include <qstring.h> #include <qlabel.h> #include <qpushbutton.h> #include "console.h" +#include <string> +#include <stdio.h> + +using namespace std; + console::console(QWidget *parent, const QStrList &run, const char *name, const QStringList &) : Widget(parent,name) { + + // Get KDE prefix + // FIXME Is there a better way to do this??? + string prefixcommand="kde-config --prefix"; + FILE *pipe_prefix; + char prefix_result[2048]; + int i; + + if ((pipe_prefix = popen(prefixcommand.c_str(), "r")) == NULL) + { + m_kdePrefix = "/usr"; + } + else { + fgets(prefix_result, 2048, pipe_prefix); + pclose(pipe_prefix); + for (i=0;i<2048;i++) { + if (prefix_result[i] == 0) { + prefix_result[i-1]=0; + i=2048; + } + } + m_kdePrefix = QString(prefix_result); + } + //label->setText( name ); loadKonsole(); konsoleFrame->installEventFilter( this ); // run command - terminal()->startProgram( "/usr/share/kdpkg/sh/kdpkg-sh", run ); + terminal()->startProgram( m_kdePrefix + "/share/kdpkg/sh/kdpkg-sh", run ); connect( konsole, SIGNAL(destroyed()), this, SLOT( finish() ) ); } |