summaryrefslogtreecommitdiffabout
path: root/kabc
Unidiff
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/stdaddressbook.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp
index 9f38f08..ec47a4e 100644
--- a/kabc/stdaddressbook.cpp
+++ b/kabc/stdaddressbook.cpp
@@ -42,95 +42,83 @@ bool StdAddressBook::mAutomaticSave = true;
42 42
43static KStaticDeleter<StdAddressBook> addressBookDeleter; 43static KStaticDeleter<StdAddressBook> addressBookDeleter;
44 44
45QString StdAddressBook::fileName() 45QString StdAddressBook::fileName()
46{ 46{
47 return locateLocal( "data", "kabc/std.vcf" ); 47 return locateLocal( "data", "kabc/std.vcf" );
48} 48}
49 49
50QString StdAddressBook::directoryName() 50QString StdAddressBook::directoryName()
51{ 51{
52 return locateLocal( "data", "kabc/stdvcf" ); 52 return locateLocal( "data", "kabc/stdvcf" );
53} 53}
54 54
55void StdAddressBook::handleCrash() 55void StdAddressBook::handleCrash()
56{ 56{
57 StdAddressBook::self()->cleanUp(); 57 StdAddressBook::self()->cleanUp();
58} 58}
59 59
60StdAddressBook *StdAddressBook::self() 60StdAddressBook *StdAddressBook::self()
61{ 61{
62 62
63 if ( !mSelf ) 63 if ( !mSelf )
64 { 64 {
65 QString appdir = StdAddressBook::setTempAppDir(); 65 QString appdir = StdAddressBook::setTempAppDir();
66 qDebug("****************************************************** ");
67 qDebug("****************************************************** ");
68 qDebug("****************************************************** ");
69 qDebug("****************************************************** ");
70 qDebug("****************************************************** ");
71// US im am not sure why I have to use the other format here?? 66// US im am not sure why I have to use the other format here??
72#ifdef KAB_EMBEDDED 67#ifdef KAB_EMBEDDED
73 mSelf = addressBookDeleter.setObject( new StdAddressBook ); 68 mSelf = addressBookDeleter.setObject( new StdAddressBook );
74#else //KAB_EMBEDDED 69#else //KAB_EMBEDDED
75 addressBookDeleter.setObject( mSelf, new StdAddressBook ); 70 addressBookDeleter.setObject( mSelf, new StdAddressBook );
76#endif //KAB_EMBEDDED 71#endif //KAB_EMBEDDED
77 KStandardDirs::setAppDir( appdir ); 72 KStandardDirs::setAppDir( appdir );
78 } 73 }
79 74
80 return mSelf; 75 return mSelf;
81} 76}
82 77
83QString StdAddressBook::setTempAppDir() 78QString StdAddressBook::setTempAppDir()
84{ 79{
85 QString appDIR = KStandardDirs::appDir(); 80 QString appDIR = KStandardDirs::appDir();
86#ifdef DESKTOP_VERSION 81#ifdef DESKTOP_VERSION
87 QString appdir = QDir::homeDirPath(); 82 QString appdir = QDir::homeDirPath();
88 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) 83 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" )
89 appdir += "kaddressbook/"; 84 appdir += "kaddressbook/";
90 else 85 else
91 appdir += "/kaddressbook/"; 86 appdir += "/kaddressbook/";
92 KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); 87 KStandardDirs::setAppDir( QDir::convertSeparators( appdir ));
93#else 88#else
94 QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook"; 89 QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook";
95 90
96 KStandardDirs::setAppDir( appdir ); 91 KStandardDirs::setAppDir( appdir );
97#endif 92#endif
98 93
99 return appDIR; 94 return appDIR;
100} 95}
101StdAddressBook *StdAddressBook::self( bool onlyFastResources ) 96StdAddressBook *StdAddressBook::self( bool onlyFastResources )
102{ 97{
103 98
104 if ( !mSelf ) 99 if ( !mSelf )
105 { 100 {
106 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
107 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
108 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
109 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
110 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
111 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
112 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
113 QString appdir =StdAddressBook::setTempAppDir(); 101 QString appdir =StdAddressBook::setTempAppDir();
114#ifdef KAB_EMBEDDED 102#ifdef KAB_EMBEDDED
115 mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); 103 mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) );
116#else //KAB_EMBEDDED 104#else //KAB_EMBEDDED
117 addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); 105 addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) );
118#endif //KAB_EMBEDDED 106#endif //KAB_EMBEDDED
119 KStandardDirs::setAppDir( appdir ); 107 KStandardDirs::setAppDir( appdir );
120 } 108 }
121 return mSelf; 109 return mSelf;
122} 110}
123 111
124StdAddressBook::StdAddressBook() 112StdAddressBook::StdAddressBook()
125 : AddressBook( "kabcrc" ) 113 : AddressBook( "kabcrc" )
126{ 114{
127 115
128 init( false ); 116 init( false );
129} 117}
130 118
131StdAddressBook::StdAddressBook( bool onlyFastResources ) 119StdAddressBook::StdAddressBook( bool onlyFastResources )
132 : AddressBook( "kabcrc" ) 120 : AddressBook( "kabcrc" )
133{ 121{
134 122
135 init( onlyFastResources ); 123 init( onlyFastResources );
136} 124}