diff options
author | gregory guy <[email protected]> | 2019-05-09 16:27:57 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-05-15 17:29:12 +0200 |
commit | b3ea5c93ad8862a3dfd1bb101b8629a82f40ed2d (patch) | |
tree | 3ffed7e487f5d406abd715a65a70a5123318252c | |
parent | 56542a067ff482aff44ac34350bc9004e0123bc4 (diff) | |
download | kdpkg-b3ea5c93ad8862a3dfd1bb101b8629a82f40ed2d.tar.gz kdpkg-b3ea5c93ad8862a3dfd1bb101b8629a82f40ed2d.zip |
Fix hardcoded installation path.
This resolves issue #1.
Signed-off-by: gregory guy <[email protected]>
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 0228e7e696f1a49495e9ec091fb5e8e22b21b3f8)
-rw-r--r-- | config.h.cmake | 3 | ||||
-rw-r--r-- | configure.in.in | 1 | ||||
-rw-r--r-- | kdpkg-install/console.cpp | 8 | ||||
-rw-r--r-- | kdpkg-install/install.cpp | 8 | ||||
-rw-r--r-- | kdpkg-install/main.cpp | 9 | ||||
-rw-r--r-- | kdpkg/main.cpp | 12 |
6 files changed, 28 insertions, 13 deletions
diff --git a/config.h.cmake b/config.h.cmake index 61ede3a..cb4462f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -6,3 +6,6 @@ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ + +/* Define the install PATH prefix */ +#define PREFIX "@CMAKE_INSTALL_PREFIX@" diff --git a/configure.in.in b/configure.in.in index 593c6a4..96f849c 100644 --- a/configure.in.in +++ b/configure.in.in @@ -4,3 +4,4 @@ AM_INIT_AUTOMAKE(kdpkg, 0.1) AC_C_BIGENDIAN AC_CHECK_KDEMAXPATHLEN +AC_DEFINE_UNQUOTED([PREFIX], ["$prefix"], [Define the install PATH prefix]) diff --git a/kdpkg-install/console.cpp b/kdpkg-install/console.cpp index 9f28dfe..fa404ce 100644 --- a/kdpkg-install/console.cpp +++ b/kdpkg-install/console.cpp @@ -18,7 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include <kgenericfactory.h> #include <kpushbutton.h> @@ -53,7 +57,7 @@ console::console(TQWidget *parent, const TQStrList &run, const char *name, const if ((pipe_prefix = popen(prefixcommand.c_str(), "r")) == NULL) { - m_kdePrefix = "/usr"; + m_kdePrefix = PREFIX; } else { fgets(prefix_result, 2048, pipe_prefix); diff --git a/kdpkg-install/install.cpp b/kdpkg-install/install.cpp index 3c78386..043342b 100644 --- a/kdpkg-install/install.cpp +++ b/kdpkg-install/install.cpp @@ -17,7 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include <kgenericfactory.h> #include <tdelocale.h> @@ -70,7 +74,7 @@ install::install( const TQString &url, TQWidget *parent, const char *name, const if ((pipe_prefix = popen(prefixcommand.c_str(), "r")) == NULL) { - m_kdePrefix = "/usr"; + m_kdePrefix = PREFIX; } else { fgets(prefix_result, 2048, pipe_prefix); diff --git a/kdpkg-install/main.cpp b/kdpkg-install/main.cpp index 0ce2b64..775c0bd 100644 --- a/kdpkg-install/main.cpp +++ b/kdpkg-install/main.cpp @@ -17,6 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include "install.h" @@ -40,7 +45,7 @@ int main(int argc, char **argv) // specify data for About dialog TDEAboutData* about = new TDEAboutData("kdpkg-install", I18N_NOOP("kdpkg-install"), ""); - about->setProgramLogo( TQImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") ); + about->setProgramLogo( TQImage( PREFIX "/share/icons/hicolor/32x32/apps/kdpkg.png") ); about->setShortDescription( I18N_NOOP("Frontend for dpkg.") ); about->setLicense(TDEAboutData::License_GPL_V2); about->setHomepage("http://trinity.pearsoncomputing.net"); @@ -50,8 +55,6 @@ int main(int argc, char **argv) about->addAuthor("Timothy Pearson (Trinity Project)", I18N_NOOP("Developer"), "[email protected]", "http://trinity.pearsoncomputing.net"); about->addAuthor("Fabian Würtz (xadras)", I18N_NOOP("Developer"), "[email protected]", "http://linux.wuertz.org/"); - - TDECmdLineArgs::init(argc, argv, about); TDECmdLineArgs::addCmdLineOptions( options ); diff --git a/kdpkg/main.cpp b/kdpkg/main.cpp index cacb438..30f2229 100644 --- a/kdpkg/main.cpp +++ b/kdpkg/main.cpp @@ -17,6 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PREFIX "/usr" +#endif #include "kdpkg.h" @@ -40,7 +45,7 @@ int main(int argc, char **argv) // specify data for About dialog TDEAboutData* about = new TDEAboutData("kdpkg", I18N_NOOP("kdpkg"), ""); - about->setProgramLogo( TQImage("/usr/share/icons/hicolor/32x32/apps/kdpkg.png") ); + about->setProgramLogo( TQImage( PREFIX "/share/icons/hicolor/32x32/apps/kdpkg.png") ); about->setShortDescription( I18N_NOOP("Frontend for dpkg.") ); about->setLicense(TDEAboutData::License_GPL_V2); about->setHomepage("http://trinity.pearsoncomputing.net"); @@ -50,11 +55,6 @@ int main(int argc, char **argv) about->addAuthor("Timothy Pearson (Trinity Project)", I18N_NOOP("Developer"), "[email protected]", "http://trinity.pearsoncomputing.net"); about->addAuthor("Fabian Würtz (xadras)", I18N_NOOP("Developer"), "[email protected]", "http://xadras.wordpress.com/"); - - - - - TDECmdLineArgs::init(argc, argv, about); TDECmdLineArgs::addCmdLineOptions( options ); |