Diffstat (limited to 'kabc/plugins/qtopia/resourceqtopiaconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/qtopia/resourceqtopiaconfig.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp index d5d6141..42fd428 100644 --- a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp +++ b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp | |||
@@ -1,81 +1,83 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
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 | //#include <unistd.h> | 38 | //#include <unistd.h> |
37 | 39 | ||
38 | #include <qdir.h> | 40 | #include <qdir.h> |
39 | #include <qfile.h> | 41 | #include <qfile.h> |
40 | #include "resourceqtopia.h" | 42 | #include "resourceqtopia.h" |
41 | 43 | ||
42 | #include "resourceqtopiaconfig.h" | 44 | #include "resourceqtopiaconfig.h" |
43 | 45 | ||
44 | using namespace KABC; | 46 | using namespace KABC; |
45 | 47 | ||
46 | ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name ) | 48 | ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name ) |
47 | : ConfigWidget( parent, name ) | 49 | : ConfigWidget( parent, name ) |
48 | { | 50 | { |
49 | QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, | 51 | Q3GridLayout *mainLayout = new Q3GridLayout( this, 1, 2, 0, |
50 | KDialog::spacingHint() ); | 52 | KDialog::spacingHint() ); |
51 | 53 | ||
52 | QLabel *label = new QLabel( i18n( "Location:" ), this ); | 54 | QLabel *label = new QLabel( i18n( "Location:" ), this ); |
53 | mFileNameEdit = new KURLRequester( this ); | 55 | mFileNameEdit = new KURLRequester( this ); |
54 | 56 | ||
55 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), | 57 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), |
56 | SLOT( checkFilePermissions( const QString & ) ) ); | 58 | SLOT( checkFilePermissions( const QString & ) ) ); |
57 | 59 | ||
58 | mainLayout->addWidget( label, 0, 0 ); | 60 | mainLayout->addWidget( label, 0, 0 ); |
59 | mainLayout->addWidget( mFileNameEdit, 0, 1 ); | 61 | mainLayout->addWidget( mFileNameEdit, 0, 1 ); |
60 | 62 | ||
61 | } | 63 | } |
62 | 64 | ||
63 | void ResourceQtopiaConfig::loadSettings( KRES::Resource *res ) | 65 | void ResourceQtopiaConfig::loadSettings( KRES::Resource *res ) |
64 | { | 66 | { |
65 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 67 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |
66 | ResourceQtopia *resource = (ResourceQtopia*)( res ); | 68 | ResourceQtopia *resource = (ResourceQtopia*)( res ); |
67 | 69 | ||
68 | if ( !resource ) { | 70 | if ( !resource ) { |
69 | kdDebug(5700) << "ResourceQtopiaConfig::loadSettings(): cast failed" << endl; | 71 | kdDebug(5700) << "ResourceQtopiaConfig::loadSettings(): cast failed" << endl; |
70 | return; | 72 | return; |
71 | } | 73 | } |
72 | 74 | ||
73 | mFileNameEdit->setURL( resource->fileName() ); | 75 | mFileNameEdit->setURL( resource->fileName() ); |
74 | if ( mFileNameEdit->url().isEmpty() ) | 76 | if ( mFileNameEdit->url().isEmpty() ) |
75 | mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" ); | 77 | mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" ); |
76 | 78 | ||
77 | //US Qtopia resources are ReadOnly by definition | 79 | //US Qtopia resources are ReadOnly by definition |
78 | emit setPersistentReadOnly( true ); | 80 | emit setPersistentReadOnly( true ); |
79 | 81 | ||
80 | //US we can not choose the filename for the qtopia backend => make it readonly. | 82 | //US we can not choose the filename for the qtopia backend => make it readonly. |
81 | mFileNameEdit->setEnabled( false ); | 83 | mFileNameEdit->setEnabled( false ); |