summaryrefslogtreecommitdiffabout
path: root/microkde/kresources
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kresources
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kresources') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/configdialog.cpp17
-rw-r--r--microkde/kresources/configpage.cpp38
-rw-r--r--microkde/kresources/configpage.h10
-rw-r--r--microkde/kresources/factory.cpp6
-rw-r--r--microkde/kresources/factory.h4
-rw-r--r--microkde/kresources/kcmkresources.cpp7
-rw-r--r--microkde/kresources/manager.h8
-rw-r--r--microkde/kresources/managerimpl.cpp10
-rw-r--r--microkde/kresources/managerimpl.h8
-rw-r--r--microkde/kresources/resource.h4
-rw-r--r--microkde/kresources/selectdialog.cpp22
-rw-r--r--microkde/kresources/selectdialog.h10
12 files changed, 82 insertions, 62 deletions
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp
index 55253c0..4820faf 100644
--- a/microkde/kresources/configdialog.cpp
+++ b/microkde/kresources/configdialog.cpp
@@ -25,14 +25,17 @@
25#include <kglobal.h> 25#include <kglobal.h>
26#include <kmessagebox.h> 26#include <kmessagebox.h>
27 27
28#include <qgroupbox.h> 28#include <q3groupbox.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qpushbutton.h> 31#include <qpushbutton.h>
32#include <qvbox.h> 32#include <q3vbox.h>
33 33
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35#include <qscrollview.h> 35#include <q3scrollview.h>
36//Added by qt3to4:
37#include <Q3VBoxLayout>
38#include <Q3Frame>
36 39
37#include <kbuttonbox.h> 40#include <kbuttonbox.h>
38#include <kdialog.h> 41#include <kdialog.h>
@@ -55,14 +58,14 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
55//US resize( 250, 240 ); 58//US resize( 250, 240 );
56 resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240)); 59 resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240));
57 60
58 QFrame *main; 61 Q3Frame *main;
59 62
60 main = plainPage(); 63 main = plainPage();
61 64
62 QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() ); 65 Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main, 0, spacingHint() );
63 66
64 67
65 QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); 68 Q3GroupBox *generalGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
66 generalGroupBox->layout()->setSpacing( spacingHint() ); 69 generalGroupBox->layout()->setSpacing( spacingHint() );
67 generalGroupBox->setTitle( i18n( "General Settings" ) ); 70 generalGroupBox->setTitle( i18n( "General Settings" ) );
68 71
@@ -82,7 +85,7 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
82 85
83 mainLayout->addWidget( generalGroupBox ); 86 mainLayout->addWidget( generalGroupBox );
84 87
85 QGroupBox *resourceGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); 88 Q3GroupBox *resourceGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
86 resourceGroupBox->layout()->setSpacing( spacingHint()); 89 resourceGroupBox->layout()->setSpacing( spacingHint());
87 resourceGroupBox->setTitle( i18n( "%1 Resource Settings" ) 90 resourceGroupBox->setTitle( i18n( "%1 Resource Settings" )
88 .arg( factory->typeName( resource->type() ) ) ); 91 .arg( factory->typeName( resource->type() ) ) );
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp
index fc7a42e..1a9d063 100644
--- a/microkde/kresources/configpage.cpp
+++ b/microkde/kresources/configpage.cpp
@@ -28,7 +28,7 @@ Copyright (c) 2004 Ulf Schenk
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qgroupbox.h> 31#include <q3groupbox.h>
32 32
33#ifdef DESKTOP_VERSION 33#ifdef DESKTOP_VERSION
34#include <qinputdialog.h> 34#include <qinputdialog.h>
@@ -37,6 +37,10 @@ $Id$
37#endif 37#endif
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qlayout.h> 39#include <qlayout.h>
40//Added by qt3to4:
41#include <Q3GridLayout>
42#include <Q3ValueList>
43#include <Q3VBoxLayout>
40#include <kapplication.h> 44#include <kapplication.h>
41#include <kcombobox.h> 45#include <kcombobox.h>
42#include <kdebug.h> 46#include <kdebug.h>
@@ -61,11 +65,11 @@ $Id$
61 65
62using namespace KRES; 66using namespace KRES;
63 67
64class ConfigViewItem : public QCheckListItem 68class ConfigViewItem : public Q3CheckListItem
65{ 69{
66 public: 70 public:
67 ConfigViewItem( QListView *parent, Resource* resource ) : 71 ConfigViewItem( Q3ListView *parent, Resource* resource ) :
68 QCheckListItem( parent, resource->resourceName(), CheckBox ), 72 Q3CheckListItem( parent, resource->resourceName(), CheckBox ),
69 mResource( resource ), 73 mResource( resource ),
70 mIsStandard( false ) 74 mIsStandard( false )
71 { 75 {
@@ -97,13 +101,13 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
97{ 101{
98 setCaption( i18n( "Resource Configuration" ) ); 102 setCaption( i18n( "Resource Configuration" ) );
99 103
100 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 104 Q3VBoxLayout *mainLayout = new Q3VBoxLayout( this );
101 105
102 QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this ); 106 Q3GroupBox *groupBox = new Q3GroupBox( i18n( "Resources" ), this );
103 groupBox->setColumnLayout(0, Qt::Vertical ); 107 groupBox->setColumnLayout(0, Qt::Vertical );
104 groupBox->layout()->setSpacing( 3 ); 108 groupBox->layout()->setSpacing( 3 );
105 groupBox->layout()->setMargin( 5 ); 109 groupBox->layout()->setMargin( 5 );
106 QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 ); 110 Q3GridLayout *groupBoxLayout = new Q3GridLayout( groupBox->layout(), 4, 2 );
107 111
108//US mFamilyCombo = new KComboBox( false, groupBox ); 112//US mFamilyCombo = new KComboBox( false, groupBox );
109 mFamilyCombo = new KComboBox( groupBox ); 113 mFamilyCombo = new KComboBox( groupBox );
@@ -145,8 +149,8 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
145 SLOT( slotFamilyChanged( int ) ) ); 149 SLOT( slotFamilyChanged( int ) ) );
146 connect( mListView, SIGNAL( selectionChanged() ), 150 connect( mListView, SIGNAL( selectionChanged() ),
147 SLOT( slotSelectionChanged() ) ); 151 SLOT( slotSelectionChanged() ) );
148 connect( mListView, SIGNAL( clicked( QListViewItem * ) ), 152 connect( mListView, SIGNAL( clicked( Q3ListViewItem * ) ),
149 SLOT( slotItemClicked( QListViewItem * ) ) ); 153 SLOT( slotItemClicked( Q3ListViewItem * ) ) );
150 154
151 mLastItem = 0; 155 mLastItem = 0;
152 156
@@ -159,7 +163,7 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
159 163
160ConfigPage::~ConfigPage() 164ConfigPage::~ConfigPage()
161{ 165{
162 QValueList<ResourcePageInfo>::Iterator it; 166 Q3ValueList<ResourcePageInfo>::Iterator it;
163 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) { 167 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) {
164 (*it).mManager->removeListener( this ); 168 (*it).mManager->removeListener( this );
165 delete (*it).mManager; 169 delete (*it).mManager;
@@ -230,7 +234,7 @@ void ConfigPage::save()
230{ 234{
231 saveResourceSettings(); 235 saveResourceSettings();
232 236
233 QValueList<ResourcePageInfo>::Iterator it; 237 Q3ValueList<ResourcePageInfo>::Iterator it;
234 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) 238 for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it )
235 (*it).mManager->writeConfig( (*it).mConfig ); 239 (*it).mManager->writeConfig( (*it).mConfig );
236 240
@@ -341,7 +345,7 @@ void ConfigPage::slotAdd()
341 // as standard resource 345 // as standard resource
342 if ( !resource->readOnly() ) { 346 if ( !resource->readOnly() ) {
343 bool onlyReadOnly = true; 347 bool onlyReadOnly = true;
344 QListViewItem *it = mListView->firstChild(); 348 Q3ListViewItem *it = mListView->firstChild();
345 while ( it != 0 ) { 349 while ( it != 0 ) {
346 ConfigViewItem *confIt = static_cast<ConfigViewItem*>( it ); 350 ConfigViewItem *confIt = static_cast<ConfigViewItem*>( it );
347 if ( !confIt->readOnly() && confIt != item ) 351 if ( !confIt->readOnly() && confIt != item )
@@ -366,7 +370,7 @@ void ConfigPage::slotRemove()
366 if ( !mCurrentManager ) 370 if ( !mCurrentManager )
367 return; 371 return;
368 372
369 QListViewItem *item = mListView->currentItem(); 373 Q3ListViewItem *item = mListView->currentItem();
370 ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item ); 374 ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item );
371 375
372 if ( !confItem ) 376 if ( !confItem )
@@ -393,7 +397,7 @@ void ConfigPage::slotEdit()
393 if ( !mCurrentManager ) 397 if ( !mCurrentManager )
394 return; 398 return;
395 399
396 QListViewItem *item = mListView->currentItem(); 400 Q3ListViewItem *item = mListView->currentItem();
397 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item ); 401 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
398 if ( !configItem ) 402 if ( !configItem )
399 return; 403 return;
@@ -435,7 +439,7 @@ void ConfigPage::slotStandard()
435 return; 439 return;
436 } 440 }
437 441
438 QListViewItem *it = mListView->firstChild(); 442 Q3ListViewItem *it = mListView->firstChild();
439 while ( it != 0 ) { 443 while ( it != 0 ) {
440 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( it ); 444 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( it );
441 if ( configItem->standard() ) 445 if ( configItem->standard() )
@@ -482,7 +486,7 @@ void ConfigPage::resourceDeleted( Resource* resource )
482 qDebug("ConfigPage::resourceDeleted : %s", resource->resourceName().latin1()); 486 qDebug("ConfigPage::resourceDeleted : %s", resource->resourceName().latin1());
483} 487}
484 488
485void ConfigPage::slotItemClicked( QListViewItem *item ) 489void ConfigPage::slotItemClicked( Q3ListViewItem *item )
486{ 490{
487 ConfigViewItem *configItem = static_cast<ConfigViewItem *>( item ); 491 ConfigViewItem *configItem = static_cast<ConfigViewItem *>( item );
488 if ( !configItem ) return; 492 if ( !configItem ) return;
@@ -504,7 +508,7 @@ void ConfigPage::saveResourceSettings()
504 508
505 if ( mCurrentManager ) { 509 if ( mCurrentManager ) {
506 510
507 QListViewItem *item = mListView->firstChild(); 511 Q3ListViewItem *item = mListView->firstChild();
508 while ( item ) { 512 while ( item ) {
509 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item ); 513 ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
510 514
diff --git a/microkde/kresources/configpage.h b/microkde/kresources/configpage.h
index be9239e..dc1aa50 100644
--- a/microkde/kresources/configpage.h
+++ b/microkde/kresources/configpage.h
@@ -25,13 +25,15 @@
25 25
26#include <qstringlist.h> 26#include <qstringlist.h>
27#include <qwidget.h> 27#include <qwidget.h>
28//Added by qt3to4:
29#include <Q3ValueList>
28 30
29#include "manager.h" 31#include "manager.h"
30 32
31class KComboBox; 33class KComboBox;
32class KListView; 34class KListView;
33 35
34class QListViewItem; 36class Q3ListViewItem;
35class QPushButton; 37class QPushButton;
36 38
37 39
@@ -73,7 +75,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource>
73 virtual void resourceDeleted( Resource* resource ); 75 virtual void resourceDeleted( Resource* resource );
74 76
75 protected slots: 77 protected slots:
76 void slotItemClicked( QListViewItem * ); 78 void slotItemClicked( Q3ListViewItem * );
77 79
78 signals: 80 signals:
79 void changed( bool ); 81 void changed( bool );
@@ -86,7 +88,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource>
86 KConfig* mConfig; 88 KConfig* mConfig;
87 QString mFamily; 89 QString mFamily;
88 QStringList mFamilyMap; 90 QStringList mFamilyMap;
89 QValueList<ResourcePageInfo> mInfoMap; 91 Q3ValueList<ResourcePageInfo> mInfoMap;
90 92
91 KComboBox* mFamilyCombo; 93 KComboBox* mFamilyCombo;
92 KListView* mListView; 94 KListView* mListView;
@@ -95,7 +97,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource>
95 QPushButton* mEditButton; 97 QPushButton* mEditButton;
96 QPushButton* mStandardButton; 98 QPushButton* mStandardButton;
97 99
98 QListViewItem* mLastItem; 100 Q3ListViewItem* mLastItem;
99 static const QString syncfamily; 101 static const QString syncfamily;
100}; 102};
101 103
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp
index 86b22b2..4f286d1 100644
--- a/microkde/kresources/factory.cpp
+++ b/microkde/kresources/factory.cpp
@@ -41,8 +41,8 @@
41#endif 41#endif
42using namespace KRES; 42using namespace KRES;
43 43
44QDict<Factory> *Factory::mSelves = 0; 44Q3Dict<Factory> *Factory::mSelves = 0;
45static KStaticDeleter< QDict<Factory> > staticDeleter; 45static KStaticDeleter< Q3Dict<Factory> > staticDeleter;
46 46
47Factory *Factory::self( const QString& resourceFamily) 47Factory *Factory::self( const QString& resourceFamily)
48{ 48{
@@ -51,7 +51,7 @@ Factory *Factory::self( const QString& resourceFamily)
51 Factory *factory = 0; 51 Factory *factory = 0;
52 if ( !mSelves ) 52 if ( !mSelves )
53 { 53 {
54 mSelves = staticDeleter.setObject( new QDict<Factory> ); 54 mSelves = staticDeleter.setObject( new Q3Dict<Factory> );
55 } 55 }
56 56
57 factory = mSelves->find( resourceFamily ); 57 factory = mSelves->find( resourceFamily );
diff --git a/microkde/kresources/factory.h b/microkde/kresources/factory.h
index ea01b23..709fde0 100644
--- a/microkde/kresources/factory.h
+++ b/microkde/kresources/factory.h
@@ -24,7 +24,7 @@
24#ifndef KRESOURCES_FACTORY_H 24#ifndef KRESOURCES_FACTORY_H
25#define KRESOURCES_FACTORY_H 25#define KRESOURCES_FACTORY_H
26 26
27#include <qdict.h> 27#include <q3dict.h>
28#include <qstring.h> 28#include <qstring.h>
29 29
30#include <kconfig.h> 30#include <kconfig.h>
@@ -114,7 +114,7 @@ class Factory
114 Factory( const QString& resourceFamily); 114 Factory( const QString& resourceFamily);
115 115
116 private: 116 private:
117 static QDict<Factory> *mSelves; 117 static Q3Dict<Factory> *mSelves;
118 118
119 QString mResourceFamily; 119 QString mResourceFamily;
120//US QMap<QString, KService::Ptr> mTypeMap; 120//US QMap<QString, KService::Ptr> mTypeMap;
diff --git a/microkde/kresources/kcmkresources.cpp b/microkde/kresources/kcmkresources.cpp
index d600a31..f5eb826 100644
--- a/microkde/kresources/kcmkresources.cpp
+++ b/microkde/kresources/kcmkresources.cpp
@@ -20,6 +20,9 @@
20*/ 20*/
21 21
22#include <qlayout.h> 22#include <qlayout.h>
23//Added by qt3to4:
24#include <Q3VBoxLayout>
25#include <Q3Frame>
23 26
24//US #include <kaboutdata.h> 27//US #include <kaboutdata.h>
25//US #include <kgenericfactory.h> 28//US #include <kgenericfactory.h>
@@ -40,9 +43,9 @@ KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringLi
40 : KDialogBase( parent, name, true, i18n( "Configure Resources" ), 43 : KDialogBase( parent, name, true, i18n( "Configure Resources" ),
41 Ok|Cancel, Ok, true ) 44 Ok|Cancel, Ok, true )
42{ 45{
43 QFrame *main = plainPage(); 46 Q3Frame *main = plainPage();
44 47
45 QVBoxLayout *layout = new QVBoxLayout( main ); 48 Q3VBoxLayout *layout = new Q3VBoxLayout( main );
46 mConfigPage = new KRES::ConfigPage( main ); 49 mConfigPage = new KRES::ConfigPage( main );
47 layout->addWidget( mConfigPage ); 50 layout->addWidget( mConfigPage );
48 51
diff --git a/microkde/kresources/manager.h b/microkde/kresources/manager.h
index 69062da..88705d4 100644
--- a/microkde/kresources/manager.h
+++ b/microkde/kresources/manager.h
@@ -32,8 +32,10 @@ $Id$
32#ifndef KRESOURCES_MANAGER_H 32#ifndef KRESOURCES_MANAGER_H
33#define KRESOURCES_MANAGER_H 33#define KRESOURCES_MANAGER_H
34 34
35#include <qdict.h> 35#include <q3dict.h>
36#include <qstringlist.h> 36#include <qstringlist.h>
37//Added by qt3to4:
38#include <Q3PtrList>
37 39
38#include "factory.h" 40#include "factory.h"
39#include "managerimpl.h" 41#include "managerimpl.h"
@@ -175,7 +177,7 @@ class Manager : private ManagerImplListener
175 mImpl = new ManagerImpl( family ); 177 mImpl = new ManagerImpl( family );
176 mImpl->setListener( this ); 178 mImpl->setListener( this );
177 179
178 mListeners = new QPtrList<ManagerListener<T> >; 180 mListeners = new Q3PtrList<ManagerListener<T> >;
179 } 181 }
180 182
181 virtual ~Manager() 183 virtual ~Manager()
@@ -330,7 +332,7 @@ class Manager : private ManagerImplListener
330 private: 332 private:
331 ManagerImpl *mImpl; 333 ManagerImpl *mImpl;
332 Factory *mFactory; 334 Factory *mFactory;
333 QPtrList<ManagerListener<T> > *mListeners; 335 Q3PtrList<ManagerListener<T> > *mListeners;
334}; 336};
335 337
336} 338}
diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp
index a6d2007..4c0751c 100644
--- a/microkde/kresources/managerimpl.cpp
+++ b/microkde/kresources/managerimpl.cpp
@@ -35,6 +35,8 @@ $Id$
35#include <kconfig.h> 35#include <kconfig.h>
36#include <kstandarddirs.h> 36#include <kstandarddirs.h>
37#include <qfile.h> 37#include <qfile.h>
38//Added by qt3to4:
39#include <Q3PtrList>
38 40
39#include "resource.h" 41#include "resource.h"
40#include "factory.h" 42#include "factory.h"
@@ -232,9 +234,9 @@ Resource::List *ManagerImpl::resourceList()
232 return &mResources; 234 return &mResources;
233} 235}
234 236
235QPtrList<Resource> ManagerImpl::resources() 237Q3PtrList<Resource> ManagerImpl::resources()
236{ 238{
237 QPtrList<Resource> result; 239 Q3PtrList<Resource> result;
238 240
239 Resource::List::ConstIterator it; 241 Resource::List::ConstIterator it;
240 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 242 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
@@ -243,9 +245,9 @@ QPtrList<Resource> ManagerImpl::resources()
243 return result; 245 return result;
244} 246}
245 247
246QPtrList<Resource> ManagerImpl::resources( bool active ) 248Q3PtrList<Resource> ManagerImpl::resources( bool active )
247{ 249{
248 QPtrList<Resource> result; 250 Q3PtrList<Resource> result;
249 251
250 Resource::List::ConstIterator it; 252 Resource::List::ConstIterator it;
251 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 253 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
diff --git a/microkde/kresources/managerimpl.h b/microkde/kresources/managerimpl.h
index 56a2db6..1f728e5 100644
--- a/microkde/kresources/managerimpl.h
+++ b/microkde/kresources/managerimpl.h
@@ -32,8 +32,8 @@ $Id$
32#define KRESOURCES_MANAGERIMPL_H 32#define KRESOURCES_MANAGERIMPL_H
33 33
34#include <qstring.h> 34#include <qstring.h>
35#include <qptrlist.h> 35#include <q3ptrlist.h>
36#include <qdict.h> 36#include <q3dict.h>
37//US 37//US
38#include <qobject.h> 38#include <qobject.h>
39 39
@@ -81,10 +81,10 @@ class ManagerImpl : public QObject
81 81
82 Resource::List *resourceList(); 82 Resource::List *resourceList();
83 83
84 QPtrList<Resource> resources(); 84 Q3PtrList<Resource> resources();
85 85
86 // Get only active or passive resources 86 // Get only active or passive resources
87 QPtrList<Resource> resources( bool active ); 87 Q3PtrList<Resource> resources( bool active );
88 88
89 QStringList resourceNames(); 89 QStringList resourceNames();
90 90
diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h
index ed5af96..1f9527c 100644
--- a/microkde/kresources/resource.h
+++ b/microkde/kresources/resource.h
@@ -28,7 +28,7 @@
28#include <qmutex.h> 28#include <qmutex.h>
29#endif //QT_THREAD_SUPPORT 29#endif //QT_THREAD_SUPPORT
30 30
31#include <qvaluelist.h> 31#include <q3valuelist.h>
32#include <qwidget.h> 32#include <qwidget.h>
33 33
34#include <qobject.h> 34#include <qobject.h>
@@ -239,7 +239,7 @@ class Resource : public QObject
239 Q_OBJECT 239 Q_OBJECT
240 240
241 public: 241 public:
242 typedef QValueList<Resource *> List; 242 typedef Q3ValueList<Resource *> List;
243 243
244 /** 244 /**
245 * Constructor. Construct resource from config. 245 * Constructor. Construct resource from config.
diff --git a/microkde/kresources/selectdialog.cpp b/microkde/kresources/selectdialog.cpp
index fba8648..d5b83e9 100644
--- a/microkde/kresources/selectdialog.cpp
+++ b/microkde/kresources/selectdialog.cpp
@@ -34,9 +34,13 @@
34//US 34//US
35#include <kglobal.h> 35#include <kglobal.h>
36 36
37#include <qlistbox.h> 37#include <q3listbox.h>
38#include <qlayout.h> 38#include <qlayout.h>
39#include <qgroupbox.h> 39#include <q3groupbox.h>
40//Added by qt3to4:
41#include <Q3VBoxLayout>
42#include <Q3Frame>
43#include <Q3PtrList>
40 44
41#include "resource.h" 45#include "resource.h"
42 46
@@ -46,7 +50,7 @@ using namespace KRES;
46 50
47//US I am using KBaseDialog instead of KDialog 51//US I am using KBaseDialog instead of KDialog
48//US : KDialog( parent, name, true ) 52//US : KDialog( parent, name, true )
49SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent, 53SelectDialog::SelectDialog( Q3PtrList<Resource> list, QWidget *parent,
50 const char *name ) 54 const char *name )
51 : KDialogBase( parent, name, true, i18n( "Resource Selection" ), Help | Ok | Cancel, 55 : KDialogBase( parent, name, true, i18n( "Resource Selection" ), Help | Ok | Cancel,
52 Ok, true) 56 Ok, true)
@@ -57,7 +61,7 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
57 resize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 200) ); 61 resize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 200) );
58 62
59//US 63//US
60 QFrame *main = plainPage(); 64 Q3Frame *main = plainPage();
61/*US 65/*US
62 QVBoxLayout *layout = new QVBoxLayout( main ); 66 QVBoxLayout *layout = new QVBoxLayout( main );
63 mConfigPage = new KRES::ConfigPage( main ); 67 mConfigPage = new KRES::ConfigPage( main );
@@ -65,15 +69,15 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
65*/ 69*/
66 70
67//US QVBoxLayout *mainLayout = new QVBoxLayout( this ); 71//US QVBoxLayout *mainLayout = new QVBoxLayout( this );
68 QVBoxLayout *mainLayout = new QVBoxLayout( main ); 72 Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main );
69 mainLayout->setMargin( marginHint() ); 73 mainLayout->setMargin( marginHint() );
70 74
71//US QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, this ); 75//US QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, this );
72 QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, main ); 76 Q3GroupBox *groupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
73 groupBox->setTitle( i18n( "Resources" ) ); 77 groupBox->setTitle( i18n( "Resources" ) );
74 78
75//US mResourceId = new KListBox( groupBox ); 79//US mResourceId = new KListBox( groupBox );
76 mResourceId = new QListBox( groupBox ); 80 mResourceId = new Q3ListBox( groupBox );
77 81
78 mainLayout->addWidget( groupBox ); 82 mainLayout->addWidget( groupBox );
79 83
@@ -101,7 +105,7 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
101 } 105 }
102 106
103 mResourceId->setCurrentItem( 0 ); 107 mResourceId->setCurrentItem( 0 );
104 connect( mResourceId, SIGNAL(returnPressed(QListBoxItem*)), 108 connect( mResourceId, SIGNAL(returnPressed(Q3ListBoxItem*)),
105 SLOT(accept()) ); 109 SLOT(accept()) );
106} 110}
107 111
@@ -113,7 +117,7 @@ Resource *SelectDialog::resource()
113 return 0; 117 return 0;
114} 118}
115 119
116Resource *SelectDialog::getResource( QPtrList<Resource> list, QWidget *parent ) 120Resource *SelectDialog::getResource( Q3PtrList<Resource> list, QWidget *parent )
117{ 121{
118 if ( list.count() == 0 ) { 122 if ( list.count() == 0 ) {
119 KMessageBox::error( parent, i18n( "There is no resource available!" ) ); 123 KMessageBox::error( parent, i18n( "There is no resource available!" ) );
diff --git a/microkde/kresources/selectdialog.h b/microkde/kresources/selectdialog.h
index 7026212..be5152b 100644
--- a/microkde/kresources/selectdialog.h
+++ b/microkde/kresources/selectdialog.h
@@ -25,13 +25,13 @@
25#define KRESOURCES_SELECTDIALOG_H 25#define KRESOURCES_SELECTDIALOG_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28#include <qptrlist.h> 28#include <q3ptrlist.h>
29#include <qmap.h> 29#include <qmap.h>
30 30
31#include <kdialogbase.h> 31#include <kdialogbase.h>
32 32
33//US class KListBox; 33//US class KListBox;
34class QListBox; 34class Q3ListBox;
35 35
36namespace KRES { 36namespace KRES {
37 37
@@ -62,7 +62,7 @@ class SelectDialog : KDialogBase
62 * @param parent The parent widget 62 * @param parent The parent widget
63 * @param name The name of the dialog 63 * @param name The name of the dialog
64 */ 64 */
65 SelectDialog( QPtrList<Resource> list, QWidget *parent = 0, 65 SelectDialog( Q3PtrList<Resource> list, QWidget *parent = 0,
66 const char *name = 0); 66 const char *name = 0);
67 67
68 // ~SelectDialog(); 68 // ~SelectDialog();
@@ -76,11 +76,11 @@ class SelectDialog : KDialogBase
76 * Open a dialog showing the available resources and return the resource the 76 * Open a dialog showing the available resources and return the resource the
77 * user has selected. Returns 0, if the dialog was canceled. 77 * user has selected. Returns 0, if the dialog was canceled.
78 */ 78 */
79 static Resource *getResource( QPtrList<Resource> list, QWidget *parent = 0 ); 79 static Resource *getResource( Q3PtrList<Resource> list, QWidget *parent = 0 );
80 80
81 private: 81 private:
82//US KListBox *mResourceId; 82//US KListBox *mResourceId;
83 QListBox *mResourceId; 83 Q3ListBox *mResourceId;
84 84
85 QMap<int, Resource*> mResourceMap; 85 QMap<int, Resource*> mResourceMap;
86}; 86};