summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/stdaddressbook.cpp17
-rw-r--r--kaddressbook/mainembedded.cpp4
-rw-r--r--korganizer/main.cpp4
3 files changed, 9 insertions, 16 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp
index 144a9dc..075f12f 100644
--- a/kabc/stdaddressbook.cpp
+++ b/kabc/stdaddressbook.cpp
@@ -4,62 +4,49 @@
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
-/*US
-#include <stdlib.h>
-
-#include <kapplication.h>
-#include <kcrash.h>
-#include <ksimpleconfig.h>
-*/
-
-#ifndef DESKTOP_VERSION
-#include <qpe/global.h>
-#else
#include <qdir.h>
-#endif
-
#include "resource.h"
#include <kresources/manager.h>
#include <kdebug.h>
#include <klocale.h>
#include <kstaticdeleter.h>
#include <kstandarddirs.h>
#include "stdaddressbook.h"
using namespace KABC;
StdAddressBook *StdAddressBook::mSelf = 0;
bool StdAddressBook::mAutomaticSave = true;
static KStaticDeleter<StdAddressBook> addressBookDeleter;
QString StdAddressBook::fileName()
{
return locateLocal( "data", "kabc/std.vcf" );
}
QString StdAddressBook::directoryName()
{
return locateLocal( "data", "kabc/stdvcf" );
@@ -80,49 +67,51 @@ StdAddressBook *StdAddressBook::self()
kdDebug(5700) << "StdAddressBook::self()" << endl;
// US im am not sure why I have to use the other format here??
#ifdef KAB_EMBEDDED
mSelf = addressBookDeleter.setObject( new StdAddressBook );
#else //KAB_EMBEDDED
addressBookDeleter.setObject( mSelf, new StdAddressBook );
#endif //KAB_EMBEDDED
KStandardDirs::setAppDir( appdir );
}
return mSelf;
}
QString StdAddressBook::setTempAppDir()
{
QString appDIR = KStandardDirs::appDir();
#ifdef DESKTOP_VERSION
QString appdir = QDir::homeDirPath();
if ( appdir.right(1) == "\\" || appdir.right(1) == "/" )
appdir += "kaddressbook/";
else
appdir += "/kaddressbook/";
KStandardDirs::setAppDir( QDir::convertSeparators( appdir ));
#else
- KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) );
+ QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook";
+
+ KStandardDirs::setAppDir( appdir );
#endif
return appDIR;
}
StdAddressBook *StdAddressBook::self( bool onlyFastResources )
{
if ( !mSelf )
{
QString appdir =StdAddressBook::setTempAppDir();
#ifdef KAB_EMBEDDED
mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) );
#else //KAB_EMBEDDED
addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) );
#endif //KAB_EMBEDDED
KStandardDirs::setAppDir( appdir );
}
return mSelf;
}
StdAddressBook::StdAddressBook()
//US : AddressBook( "kabcrc" )
: AddressBook( locateLocal( "config", "kabcrc") )
{
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 3f6f69d..47b5484 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -19,49 +19,51 @@ 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& )));
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 6843595..a357988 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -36,49 +36,51 @@ int main( int argc, char **argv )
printf(" -help: This output\n");
printf("Next Option: Open or Show after start:\n");
printf(" -newTodo: New Todo dialog\n");
printf(" -newEvent: New Event dialog\n");
printf(" -showList: List view\n");
printf(" -showDay: Day view\n");
printf(" -showWWeek: Work Week view\n");
printf(" -showWeek: Week view\n");
printf(" -showTodo: Todo view\n");
printf(" -showJournal: Journal view\n");
printf(" -showKO: Next Days view\n");
printf(" -showWNext: What's Next view\n");
printf(" -showNextXView: Next X View\n");
printf(" -new[Y] and -show[X] may be used togehther\n");
printf(" KO/Pi is exiting now. Bye!\n");
exitHelp = true;
}
}
if ( ! exitHelp ) {
KGlobal::setAppName( "korganizer" );
QString fileName ;
#ifndef DESKTOP_VERSION
- KStandardDirs::setAppDir( Global::applicationFileName( "korganizer", "" ) );
+ QString appdir = QDir::homeDirPath() + "/kdepim/apps/" + KGlobal::getAppName();
+ KStandardDirs::setAppDir( appdir );
+
fileName = getenv("QPEDIR");
KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
#else
#ifndef _WIN32_
fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
#else
fileName = qApp->applicationDirPath () + "\\kdepim\\korganizer\\";
#endif
KGlobal::iconLoader()->setIconPath(fileName);
QString appdir = QDir::homeDirPath();
//appdir = "C:\\";
if ( appdir.right(1) == "\\" || appdir.right(1) == "/" )
appdir += "korganizer";
else
appdir += "/korganizer";
KStandardDirs::setAppDir( QDir::convertSeparators( appdir ));
// qDebug(" %s ",KStandardDirs::appDir().latin1() );
#endif
QDir app_dir;
if ( !app_dir.exists(KStandardDirs::appDir()) )
app_dir.mkdir (KStandardDirs::appDir());