summaryrefslogtreecommitdiffabout
path: root/kaddressbook/mainembedded.cpp
authorulf69 <ulf69>2004-07-02 15:35:34 (UTC)
committer ulf69 <ulf69>2004-07-02 15:35:34 (UTC)
commitb21b6754c93e5aaa53638a060e26f4efea755d37 (patch) (side-by-side diff)
tree2a78ca54cda74c2bff11c1244741d1bc48994ad6 /kaddressbook/mainembedded.cpp
parentbb7ad945c1541684a02e853fdaabd0e3ba74f8df (diff)
downloadkdepimpi-b21b6754c93e5aaa53638a060e26f4efea755d37.zip
kdepimpi-b21b6754c93e5aaa53638a060e26f4efea755d37.tar.gz
kdepimpi-b21b6754c93e5aaa53638a060e26f4efea755d37.tar.bz2
removed references to Global::applicationFileName because this call creates the appdir
in ~/Applications/ which is not correct for MicroKDE
Diffstat (limited to 'kaddressbook/mainembedded.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 3f6f69d..47b5484 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,139 +1,141 @@
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#include <qpe/global.h>
#include <stdlib.h>
#else
#include <qapplication.h>
#include <qwindowsstyle.h>
#include <qplatinumstyle.h>
#include <qmainwindow.h>
#endif
#include <kstandarddirs.h>
#include <kglobal.h>
#include <stdio.h>
#include <qdir.h>
#include "kaddressbookmain.h"
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
#else
QApplication a( argc, argv );
QApplication::setStyle( new QPlatinumStyle ());
#endif
bool exitHelp = false;
if ( argc > 1 ) {
QString command = argv[1];
if ( command == "-help" ){
printf("KA/E command line commands:\n");
printf(" no command: Start KA/E in usual way\n");
printf(" -help: This output\n");
printf(" KA/E is exiting now. Bye!\n");
exitHelp = true;
}
}
if ( ! exitHelp ) {
KGlobal::setAppName( "kaddressbook" );
#ifndef DESKTOP_VERSION
- KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) );
+ QString appdir = QDir::homeDirPath() + "/kdepim/apps/" + KGlobal::getAppName();
+
+ KStandardDirs::setAppDir( appdir );
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
#else
QString fileName ;
#ifndef _WIN32_
fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/";
#else
fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\";
#endif
KGlobal::iconLoader()->setIconPath(fileName);
QString appdir = QDir::homeDirPath();
if ( appdir.right(1) == "\\" || appdir.right(1) == "/" )
appdir += "kaddressbook";
else
appdir += "/kaddressbook";
KStandardDirs::setAppDir( QDir::convertSeparators( appdir ));
// qDebug(" %s ",KStandardDirs::appDir().latin1() );
#endif // desktop
QDir app_dir;
if ( !app_dir.exists(KStandardDirs::appDir()) )
app_dir.mkdir (KStandardDirs::appDir());
KAddressBookMain* m = new KAddressBookMain();
//US MainWindow m;
//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
#ifndef DESKTOP_VERSION
a.showMainWidget(m );
m->showMaximized();
#else
a.setMainWidget(m );
m->show();
//m->resize( 640, 480 );
#endif
a.exec();
}
qDebug("KA: Bye! ");
}
/*
#include <stdlib.h>
#include <qstring.h>
#include <kabc/stdaddressbook.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kcrash.h>
#include <kdebug.h>
#include <klocale.h>
#include <kstartupinfo.h>
#include <kuniqueapplication.h>
#include <kwin.h>
#include "kaddressbookmain.h"
#include "kabcore.h"
extern "C" {
void crashHandler( int )
{
KABC::StdAddressBook::handleCrash();
::exit( 0 );
}
}
class KAddressBookApp : public KUniqueApplication {
public:
KAddressBookApp() : mMainWin( 0 ) {}
~KAddressBookApp() {}
int newInstance();
private:
KAddressBookMain *mMainWin;
};
int KAddressBookApp::newInstance()
{
if ( isRestored() ) {
// There can only be one main window
if ( KMainWindow::canBeRestored( 1 ) ) {
mMainWin = new KAddressBookMain;
mMainWin->show();
mMainWin->restore( 1 );
}
} else {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QCString addrStr = args->getOption( "addr" );
QCString uidStr = args->getOption( "uid" );
QString addr;
QString uid;
if ( !addrStr.isEmpty() )