author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/plugins/dir | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kabc/plugins/dir/dir.pro | 14 | ||||
-rw-r--r-- | kabc/plugins/dir/dirE.pro | 4 | ||||
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 8 | ||||
-rw-r--r-- | kabc/plugins/dir/resourcedirconfig.cpp | 4 |
4 files changed, 18 insertions, 12 deletions
diff --git a/kabc/plugins/dir/dir.pro b/kabc/plugins/dir/dir.pro index 3e18594..9b3b894 100644 --- a/kabc/plugins/dir/dir.pro +++ b/kabc/plugins/dir/dir.pro | |||
@@ -1,18 +1,18 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | #release debug | 3 | #release debug |
4 | 4 | ||
5 | include( ../../../variables.pri ) | 5 | include( ../../../variables.pri ) |
6 | 6 | ||
7 | TARGET = microkabc_dir | 7 | TARGET = xmicrokabc_dir |
8 | INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat | 8 | INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat |
9 | DESTDIR = ../../../bin | 9 | DESTDIR = ../../../bin |
10 | #LIBS += -lmicrokde -lmicrokabc | 10 | #LIBS += -lxmicrokde -lxmicrokabc |
11 | #LIBS += -L$(QPEDIR)/lib | 11 | #LIBS += -L$(QPEDIR)/lib |
12 | 12 | ||
13 | INTERFACES = \ | 13 | INTERFACES = \ |
14 | 14 | ||
15 | HEADERS = \ | 15 | HEADERS = \ |
16 | resourcedir.h \ | 16 | resourcedir.h \ |
17 | resourcedirconfig.h | 17 | resourcedirconfig.h |
18 | 18 | ||
@@ -24,13 +24,17 @@ unix : { | |||
24 | OBJECTS_DIR = obj/unix | 24 | OBJECTS_DIR = obj/unix |
25 | MOC_DIR = moc/unix | 25 | MOC_DIR = moc/unix |
26 | } | 26 | } |
27 | win32: { | 27 | win32: { |
28 | CONFIG += dll | 28 | CONFIG += dll |
29 | DEFINES += _WIN32_ | 29 | DEFINES += _WIN32_ |
30 | OBJECTS_DIR = obj/win | 30 | OBJECTS_DIR = obj/win |
31 | MOC_DIR = moc/win | 31 | MOC_DIR = moc/win |
32 | LIBS += ../../../bin/microkdepim.lib | 32 | LIBS += ../../../bin/xmicrokdepim.lib |
33 | LIBS += ../../../bin/microkcal.lib | 33 | LIBS += ../../../bin/xmicrokcal.lib |
34 | LIBS += ../../../bin/microkde.lib | 34 | LIBS += ../../../bin/xmicrokde.lib |
35 | LIBS += ../../../bin/microkabc.lib | 35 | LIBS += ../../../bin/microkabc.lib |
36 | } | 36 | } |
37 | #The following line was inserted by qt3to4 | ||
38 | QT += qt3support | ||
39 | #The following line was inserted by qt3to4 | ||
40 | QT += xml | ||
diff --git a/kabc/plugins/dir/dirE.pro b/kabc/plugins/dir/dirE.pro index cda4e2f..75332a0 100644 --- a/kabc/plugins/dir/dirE.pro +++ b/kabc/plugins/dir/dirE.pro | |||
@@ -1,18 +1,18 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | #release debug | 3 | #release debug |
4 | 4 | ||
5 | TARGET = microkabc_dir | 5 | TARGET = xmicrokabc_dir |
6 | INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat | 6 | INCLUDEPATH += $(KDEPIMDIR)/kabc $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kresources $(KDEPIMDIR)/qtcompat |
7 | OBJECTS_DIR = obj/$(PLATFORM) | 7 | OBJECTS_DIR = obj/$(PLATFORM) |
8 | MOC_DIR = moc/$(PLATFORM) | 8 | MOC_DIR = moc/$(PLATFORM) |
9 | DESTDIR = $(QPEDIR)/lib | 9 | DESTDIR = $(QPEDIR)/lib |
10 | LIBS += -lmicrokde -lmicrokabc | 10 | LIBS += -lxmicrokde -lxmicrokabc |
11 | LIBS += -L$(QPEDIR)/lib | 11 | LIBS += -L$(QPEDIR)/lib |
12 | 12 | ||
13 | INTERFACES = \ | 13 | INTERFACES = \ |
14 | 14 | ||
15 | HEADERS = \ | 15 | HEADERS = \ |
16 | resourcedir.h \ | 16 | resourcedir.h \ |
17 | resourcedirconfig.h | 17 | resourcedirconfig.h |
18 | 18 | ||
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index c61664b..cc4afee 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -165,17 +165,17 @@ bool ResourceDir::doOpen() | |||
165 | if ( !dir.exists() ) { // no directory available | 165 | if ( !dir.exists() ) { // no directory available |
166 | return dir.mkdir( dir.path() ); | 166 | return dir.mkdir( dir.path() ); |
167 | } else { | 167 | } else { |
168 | QString testName = dir.entryList( QDir::Files )[0]; | 168 | QString testName = dir.entryList( QDir::Files )[0]; |
169 | if ( testName.isNull() || testName.isEmpty() ) // no file in directory | 169 | if ( testName.isNull() || testName.isEmpty() ) // no file in directory |
170 | return true; | 170 | return true; |
171 | 171 | ||
172 | QFile file( mPath + "/" + testName ); | 172 | QFile file( mPath + "/" + testName ); |
173 | if ( file.open( IO_ReadOnly ) ) | 173 | if ( file.open( QIODevice::ReadOnly ) ) |
174 | return true; | 174 | return true; |
175 | 175 | ||
176 | if ( file.size() == 0 ) | 176 | if ( file.size() == 0 ) |
177 | return true; | 177 | return true; |
178 | 178 | ||
179 | bool ok = mFormat->checkFormat( &file ); | 179 | bool ok = mFormat->checkFormat( &file ); |
180 | file.close(); | 180 | file.close(); |
181 | return ok; | 181 | return ok; |
@@ -191,17 +191,17 @@ bool ResourceDir::load() | |||
191 | QDir dir( mPath ); | 191 | QDir dir( mPath ); |
192 | QStringList files = dir.entryList( QDir::Files ); | 192 | QStringList files = dir.entryList( QDir::Files ); |
193 | 193 | ||
194 | QStringList::Iterator it; | 194 | QStringList::Iterator it; |
195 | bool ok = true; | 195 | bool ok = true; |
196 | for ( it = files.begin(); it != files.end(); ++it ) { | 196 | for ( it = files.begin(); it != files.end(); ++it ) { |
197 | QFile file( mPath + "/" + (*it) ); | 197 | QFile file( mPath + "/" + (*it) ); |
198 | 198 | ||
199 | if ( !file.open( IO_ReadOnly ) ) { | 199 | if ( !file.open( QIODevice::ReadOnly ) ) { |
200 | addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); | 200 | addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); |
201 | ok = false; | 201 | ok = false; |
202 | continue; | 202 | continue; |
203 | } | 203 | } |
204 | 204 | ||
205 | if ( !mFormat->loadAll( addressBook(), this, &file ) ) | 205 | if ( !mFormat->loadAll( addressBook(), this, &file ) ) |
206 | ok = false; | 206 | ok = false; |
207 | 207 | ||
@@ -218,17 +218,17 @@ bool ResourceDir::save( Ticket *ticket ) | |||
218 | #ifndef NO_DIRWATCH | 218 | #ifndef NO_DIRWATCH |
219 | mDirWatch.stopScan(); | 219 | mDirWatch.stopScan(); |
220 | #endif | 220 | #endif |
221 | for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { | 221 | for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { |
222 | if ( (*it).resource() != this || !(*it).changed() ) | 222 | if ( (*it).resource() != this || !(*it).changed() ) |
223 | continue; | 223 | continue; |
224 | 224 | ||
225 | QFile file( mPath + "/" + (*it).uid() ); | 225 | QFile file( mPath + "/" + (*it).uid() ); |
226 | if ( !file.open( IO_WriteOnly ) ) { | 226 | if ( !file.open( QIODevice::WriteOnly ) ) { |
227 | addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); | 227 | addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); |
228 | continue; | 228 | continue; |
229 | } | 229 | } |
230 | 230 | ||
231 | mFormat->save( *it, &file ); | 231 | mFormat->save( *it, &file ); |
232 | 232 | ||
233 | // mark as unchanged | 233 | // mark as unchanged |
234 | (*it).setChanged( false ); | 234 | (*it).setChanged( false ); |
@@ -262,17 +262,17 @@ bool ResourceDir::lock( const QString &path ) | |||
262 | lockUniqueName = p + KApplication::randomString( 8 ); | 262 | lockUniqueName = p + KApplication::randomString( 8 ); |
263 | 263 | ||
264 | url = lockUniqueName; | 264 | url = lockUniqueName; |
265 | //US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); | 265 | //US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); |
266 | mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); | 266 | mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); |
267 | 267 | ||
268 | // Create unique file | 268 | // Create unique file |
269 | QFile file( mLockUniqueName ); | 269 | QFile file( mLockUniqueName ); |
270 | file.open( IO_WriteOnly ); | 270 | file.open( QIODevice::WriteOnly ); |
271 | file.close(); | 271 | file.close(); |
272 | 272 | ||
273 | // Create lock file | 273 | // Create lock file |
274 | int result = 0; | 274 | int result = 0; |
275 | #ifndef _WIN32_ | 275 | #ifndef _WIN32_ |
276 | result = ::link( QFile::encodeName( mLockUniqueName ), | 276 | result = ::link( QFile::encodeName( mLockUniqueName ), |
277 | QFile::encodeName( lockName ) ); | 277 | QFile::encodeName( lockName ) ); |
278 | #endif | 278 | #endif |
diff --git a/kabc/plugins/dir/resourcedirconfig.cpp b/kabc/plugins/dir/resourcedirconfig.cpp index 98d18fe..8fa48d0 100644 --- a/kabc/plugins/dir/resourcedirconfig.cpp +++ b/kabc/plugins/dir/resourcedirconfig.cpp | |||
@@ -22,16 +22,18 @@ | |||
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3GridLayout> | ||
30 | 32 | ||
31 | #include <kdebug.h> | 33 | #include <kdebug.h> |
32 | #include <klocale.h> | 34 | #include <klocale.h> |
33 | #include <kstandarddirs.h> | 35 | #include <kstandarddirs.h> |
34 | #include <kdialog.h> | 36 | #include <kdialog.h> |
35 | 37 | ||
36 | //US #include "formatfactory.h" | 38 | //US #include "formatfactory.h" |
37 | #include "resourcedir.h" | 39 | #include "resourcedir.h" |
@@ -39,17 +41,17 @@ $Id$ | |||
39 | 41 | ||
40 | #include "resourcedirconfig.h" | 42 | #include "resourcedirconfig.h" |
41 | 43 | ||
42 | using namespace KABC; | 44 | using namespace KABC; |
43 | 45 | ||
44 | ResourceDirConfig::ResourceDirConfig( QWidget* parent, const char* name ) | 46 | ResourceDirConfig::ResourceDirConfig( QWidget* parent, const char* name ) |
45 | : KRES::ConfigWidget( parent, name ) | 47 | : KRES::ConfigWidget( parent, name ) |
46 | { | 48 | { |
47 | QGridLayout *mainLayout = new QGridLayout( this, 2, 2, 0, | 49 | Q3GridLayout *mainLayout = new Q3GridLayout( this, 2, 2, 0, |
48 | KDialog::spacingHint() ); | 50 | KDialog::spacingHint() ); |
49 | 51 | ||
50 | QLabel *label = new QLabel( i18n( "Format:" ), this ); | 52 | QLabel *label = new QLabel( i18n( "Format:" ), this ); |
51 | mFormatBox = new KComboBox( this ); | 53 | mFormatBox = new KComboBox( this ); |
52 | 54 | ||
53 | mainLayout->addWidget( label, 0, 0 ); | 55 | mainLayout->addWidget( label, 0, 0 ); |
54 | mainLayout->addWidget( mFormatBox, 0, 1 ); | 56 | mainLayout->addWidget( mFormatBox, 0, 1 ); |
55 | 57 | ||