diff --git a/MainWindow.cpp b/MainWindow.cpp index 9ff9e5b9..6a914ebe 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -64,8 +64,15 @@ MainWindow::MainWindow(QWidget *parent, const char *name ) connect( (QObject *)quitApp, SIGNAL(clicked()), (QObject *)qApp, SLOT(quit()) ); QString cpr = "(c) 2002 by Christian@Hohnstaedt.de - Version: "; copyright->setText(cpr + VER); - baseDir = QDir::homeDirPath() + BASE_DIR; +#ifndef HAVE_CONGIG_H + baseDir = "C:"; +#else + baseDir = QDir::homeDirPath(); +#endif + baseDir += QDir::separator(); + baseDir += BASE_DIR; dbenv = new DbEnv(DB_CXX_NO_EXCEPTIONS | DB_INIT_TXN ); + CERR << baseDir.latin1() <argv()[1]; } - dbfile = baseDir + "/" + dbfile; + dbfile = baseDir + QDir::separator() + dbfile; ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); settings = new db_base(dbenv, dbfile.latin1(), "settings"); diff --git a/MainWindow.h b/MainWindow.h index 62f010e7..32ec9cd7 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -95,14 +95,14 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#define BASE_DIR "/xca" #define DBFILE "xca.db" #ifndef CERR #define CERR cerr #endif -#ifndef HAVE_CONFIG_H -#define VER "0.2.4-win" -#endif +#ifndef HAVE_CONFIG_H +#define VER "0.2.4-win" +#endif + class MainWindow: public MainWindow_UI { diff --git a/lib/db_base.cpp b/lib/db_base.cpp index 27d7e365..17a8ef73 100644 --- a/lib/db_base.cpp +++ b/lib/db_base.cpp @@ -414,9 +414,19 @@ pki_base *db_base::findPKI(pki_base *refpki) QPixmap *db_base::loadImg(const char *name ) { - QString path = PREFIX; - path += "/"; - return new QPixmap(path + name); + QString path =""; +#ifndef HAVE_CONFIG_H + path = "C:"; + path += QDir::separator(); + path += BASE_DIR ; +#else + path = QDir::homeDirPath() + QDir::separator(); + path += PREFIX ; +#endif + path += QDir::separator(); + path += name; + QMessageBox::information(NULL, "xca", path); + return new QPixmap(path); } void db_base::updateViewPKI(pki_base *pki) diff --git a/lib/db_base.h b/lib/db_base.h index 9248c405..d72f5947 100644 --- a/lib/db_base.h +++ b/lib/db_base.h @@ -49,7 +49,8 @@ */ #ifdef HAVE_CONFIG_H -#include "../config.h" +#include "../config.h" + #ifdef HAVE_DB4_DB_CXX_H #include #elif HAVE_DB3_DB_CXX_H @@ -62,16 +63,20 @@ #ifdef HAVE_QACCESSIBLE_H #define qt3 1 #endif -#else -#include -#define PREFIX "c:\xca" -#endif +#else // HAVE_CONFIG_H + +#include +#endif // HAVE_CONFIG_H + #include #include +#include +#include #include #include #include "pki_base.h" +#define BASE_DIR "xca" #ifndef DB_BASE_H #define DB_BASE_H