Diffstat (limited to 'kabc/plugins/qtopia/resourceqtopiaconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/qtopia/resourceqtopiaconfig.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp index b2310c4..0505d0b 100644 --- a/kabc/plugins/qtopia/resourceqtopiaconfig.cpp +++ b/kabc/plugins/qtopia/resourceqtopiaconfig.cpp | |||
@@ -1,91 +1,88 @@ | |||
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 | 30 | ||
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <klocale.h> | 32 | #include <klocale.h> |
33 | #include <kstandarddirs.h> | 33 | #include <kstandarddirs.h> |
34 | #include <kdialog.h> | 34 | #include <kdialog.h> |
35 | 35 | ||
36 | #include <unistd.h> | 36 | #include <unistd.h> |
37 | 37 | ||
38 | #include <qdir.h> | 38 | #include <qdir.h> |
39 | #include <qfile.h> | 39 | #include <qfile.h> |
40 | #include "resourceqtopia.h" | 40 | #include "resourceqtopia.h" |
41 | //US #include <qpe/qpeapplication.h> | ||
42 | |||
43 | //US #include "stdaddressbook.h" | ||
44 | 41 | ||
45 | #include "resourceqtopiaconfig.h" | 42 | #include "resourceqtopiaconfig.h" |
46 | 43 | ||
47 | using namespace KABC; | 44 | using namespace KABC; |
48 | 45 | ||
49 | ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name ) | 46 | ResourceQtopiaConfig::ResourceQtopiaConfig( QWidget* parent, const char* name ) |
50 | : ConfigWidget( parent, name ) | 47 | : ConfigWidget( parent, name ) |
51 | { | 48 | { |
52 | QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, | 49 | QGridLayout *mainLayout = new QGridLayout( this, 1, 2, 0, |
53 | KDialog::spacingHint() ); | 50 | KDialog::spacingHint() ); |
54 | 51 | ||
55 | QLabel *label = new QLabel( i18n( "Location:" ), this ); | 52 | QLabel *label = new QLabel( i18n( "Location:" ), this ); |
56 | mFileNameEdit = new KURLRequester( this ); | 53 | mFileNameEdit = new KURLRequester( this ); |
57 | 54 | ||
58 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), | 55 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), |
59 | SLOT( checkFilePermissions( const QString & ) ) ); | 56 | SLOT( checkFilePermissions( const QString & ) ) ); |
60 | 57 | ||
61 | mainLayout->addWidget( label, 0, 0 ); | 58 | mainLayout->addWidget( label, 0, 0 ); |
62 | mainLayout->addWidget( mFileNameEdit, 0, 1 ); | 59 | mainLayout->addWidget( mFileNameEdit, 0, 1 ); |
63 | 60 | ||
64 | } | 61 | } |
65 | 62 | ||
66 | void ResourceQtopiaConfig::loadSettings( KRES::Resource *res ) | 63 | void ResourceQtopiaConfig::loadSettings( KRES::Resource *res ) |
67 | { | 64 | { |
68 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 65 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |
69 | ResourceQtopia *resource = (ResourceQtopia*)( res ); | 66 | ResourceQtopia *resource = (ResourceQtopia*)( res ); |
70 | 67 | ||
71 | if ( !resource ) { | 68 | if ( !resource ) { |
72 | kdDebug(5700) << "ResourceQtopiaConfig::loadSettings(): cast failed" << endl; | 69 | kdDebug(5700) << "ResourceQtopiaConfig::loadSettings(): cast failed" << endl; |
73 | return; | 70 | return; |
74 | } | 71 | } |
75 | 72 | ||
76 | mFileNameEdit->setURL( resource->fileName() ); | 73 | mFileNameEdit->setURL( resource->fileName() ); |
77 | if ( mFileNameEdit->url().isEmpty() ) | 74 | if ( mFileNameEdit->url().isEmpty() ) |
78 | mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" ); | 75 | mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" ); |
79 | 76 | ||
80 | //US Qtopia resources are ReadOnly by definition | 77 | //US Qtopia resources are ReadOnly by definition |
81 | emit setPersistentReadOnly( true ); | 78 | emit setPersistentReadOnly( true ); |
82 | 79 | ||
83 | //US we can not choose the filename for the qtopia backend => make it readonly. | 80 | //US we can not choose the filename for the qtopia backend => make it readonly. |
84 | mFileNameEdit->setEnabled( false ); | 81 | mFileNameEdit->setEnabled( false ); |
85 | 82 | ||
86 | } | 83 | } |
87 | 84 | ||
88 | void ResourceQtopiaConfig::saveSettings( KRES::Resource *res ) | 85 | void ResourceQtopiaConfig::saveSettings( KRES::Resource *res ) |
89 | { | 86 | { |
90 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 87 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |
91 | ResourceQtopia *resource = (ResourceQtopia*)( res ); | 88 | ResourceQtopia *resource = (ResourceQtopia*)( res ); |