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) (side-by-side diff)
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) (show 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 @@
#include <kglobal.h>
#include <kmessagebox.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
-#include <qvbox.h>
+#include <q3vbox.h>
#include <qcheckbox.h>
-#include <qscrollview.h>
+#include <q3scrollview.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3Frame>
#include <kbuttonbox.h>
#include <kdialog.h>
@@ -55,14 +58,14 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
//US resize( 250, 240 );
resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240));
- QFrame *main;
+ Q3Frame *main;
main = plainPage();
- QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() );
+ Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main, 0, spacingHint() );
- QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main );
+ Q3GroupBox *generalGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
generalGroupBox->layout()->setSpacing( spacingHint() );
generalGroupBox->setTitle( i18n( "General Settings" ) );
@@ -82,7 +85,7 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
mainLayout->addWidget( generalGroupBox );
- QGroupBox *resourceGroupBox = new QGroupBox( 2, Qt::Horizontal, main );
+ Q3GroupBox *resourceGroupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
resourceGroupBox->layout()->setSpacing( spacingHint());
resourceGroupBox->setTitle( i18n( "%1 Resource Settings" )
.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
$Id$
*/
-#include <qgroupbox.h>
+#include <q3groupbox.h>
#ifdef DESKTOP_VERSION
#include <qinputdialog.h>
@@ -37,6 +37,10 @@ $Id$
#endif
#include <qlabel.h>
#include <qlayout.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3ValueList>
+#include <Q3VBoxLayout>
#include <kapplication.h>
#include <kcombobox.h>
#include <kdebug.h>
@@ -61,11 +65,11 @@ $Id$
using namespace KRES;
-class ConfigViewItem : public QCheckListItem
+class ConfigViewItem : public Q3CheckListItem
{
public:
- ConfigViewItem( QListView *parent, Resource* resource ) :
- QCheckListItem( parent, resource->resourceName(), CheckBox ),
+ ConfigViewItem( Q3ListView *parent, Resource* resource ) :
+ Q3CheckListItem( parent, resource->resourceName(), CheckBox ),
mResource( resource ),
mIsStandard( false )
{
@@ -97,13 +101,13 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
{
setCaption( i18n( "Resource Configuration" ) );
- QVBoxLayout *mainLayout = new QVBoxLayout( this );
+ Q3VBoxLayout *mainLayout = new Q3VBoxLayout( this );
- QGroupBox *groupBox = new QGroupBox( i18n( "Resources" ), this );
+ Q3GroupBox *groupBox = new Q3GroupBox( i18n( "Resources" ), this );
groupBox->setColumnLayout(0, Qt::Vertical );
groupBox->layout()->setSpacing( 3 );
groupBox->layout()->setMargin( 5 );
- QGridLayout *groupBoxLayout = new QGridLayout( groupBox->layout(), 4, 2 );
+ Q3GridLayout *groupBoxLayout = new Q3GridLayout( groupBox->layout(), 4, 2 );
//US mFamilyCombo = new KComboBox( false, groupBox );
mFamilyCombo = new KComboBox( groupBox );
@@ -145,8 +149,8 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
SLOT( slotFamilyChanged( int ) ) );
connect( mListView, SIGNAL( selectionChanged() ),
SLOT( slotSelectionChanged() ) );
- connect( mListView, SIGNAL( clicked( QListViewItem * ) ),
- SLOT( slotItemClicked( QListViewItem * ) ) );
+ connect( mListView, SIGNAL( clicked( Q3ListViewItem * ) ),
+ SLOT( slotItemClicked( Q3ListViewItem * ) ) );
mLastItem = 0;
@@ -159,7 +163,7 @@ ConfigPage::ConfigPage( QWidget *parent, const char *name )
ConfigPage::~ConfigPage()
{
- QValueList<ResourcePageInfo>::Iterator it;
+ Q3ValueList<ResourcePageInfo>::Iterator it;
for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) {
(*it).mManager->removeListener( this );
delete (*it).mManager;
@@ -230,7 +234,7 @@ void ConfigPage::save()
{
saveResourceSettings();
- QValueList<ResourcePageInfo>::Iterator it;
+ Q3ValueList<ResourcePageInfo>::Iterator it;
for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it )
(*it).mManager->writeConfig( (*it).mConfig );
@@ -341,7 +345,7 @@ void ConfigPage::slotAdd()
// as standard resource
if ( !resource->readOnly() ) {
bool onlyReadOnly = true;
- QListViewItem *it = mListView->firstChild();
+ Q3ListViewItem *it = mListView->firstChild();
while ( it != 0 ) {
ConfigViewItem *confIt = static_cast<ConfigViewItem*>( it );
if ( !confIt->readOnly() && confIt != item )
@@ -366,7 +370,7 @@ void ConfigPage::slotRemove()
if ( !mCurrentManager )
return;
- QListViewItem *item = mListView->currentItem();
+ Q3ListViewItem *item = mListView->currentItem();
ConfigViewItem *confItem = static_cast<ConfigViewItem*>( item );
if ( !confItem )
@@ -393,7 +397,7 @@ void ConfigPage::slotEdit()
if ( !mCurrentManager )
return;
- QListViewItem *item = mListView->currentItem();
+ Q3ListViewItem *item = mListView->currentItem();
ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
if ( !configItem )
return;
@@ -435,7 +439,7 @@ void ConfigPage::slotStandard()
return;
}
- QListViewItem *it = mListView->firstChild();
+ Q3ListViewItem *it = mListView->firstChild();
while ( it != 0 ) {
ConfigViewItem *configItem = static_cast<ConfigViewItem*>( it );
if ( configItem->standard() )
@@ -482,7 +486,7 @@ void ConfigPage::resourceDeleted( Resource* resource )
qDebug("ConfigPage::resourceDeleted : %s", resource->resourceName().latin1());
}
-void ConfigPage::slotItemClicked( QListViewItem *item )
+void ConfigPage::slotItemClicked( Q3ListViewItem *item )
{
ConfigViewItem *configItem = static_cast<ConfigViewItem *>( item );
if ( !configItem ) return;
@@ -504,7 +508,7 @@ void ConfigPage::saveResourceSettings()
if ( mCurrentManager ) {
- QListViewItem *item = mListView->firstChild();
+ Q3ListViewItem *item = mListView->firstChild();
while ( item ) {
ConfigViewItem *configItem = static_cast<ConfigViewItem*>( item );
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 @@
#include <qstringlist.h>
#include <qwidget.h>
+//Added by qt3to4:
+#include <Q3ValueList>
#include "manager.h"
class KComboBox;
class KListView;
-class QListViewItem;
+class Q3ListViewItem;
class QPushButton;
@@ -73,7 +75,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource>
virtual void resourceDeleted( Resource* resource );
protected slots:
- void slotItemClicked( QListViewItem * );
+ void slotItemClicked( Q3ListViewItem * );
signals:
void changed( bool );
@@ -86,7 +88,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource>
KConfig* mConfig;
QString mFamily;
QStringList mFamilyMap;
- QValueList<ResourcePageInfo> mInfoMap;
+ Q3ValueList<ResourcePageInfo> mInfoMap;
KComboBox* mFamilyCombo;
KListView* mListView;
@@ -95,7 +97,7 @@ class ConfigPage : public QWidget, public ManagerListener<Resource>
QPushButton* mEditButton;
QPushButton* mStandardButton;
- QListViewItem* mLastItem;
+ Q3ListViewItem* mLastItem;
static const QString syncfamily;
};
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 @@
#endif
using namespace KRES;
-QDict<Factory> *Factory::mSelves = 0;
-static KStaticDeleter< QDict<Factory> > staticDeleter;
+Q3Dict<Factory> *Factory::mSelves = 0;
+static KStaticDeleter< Q3Dict<Factory> > staticDeleter;
Factory *Factory::self( const QString& resourceFamily)
{
@@ -51,7 +51,7 @@ Factory *Factory::self( const QString& resourceFamily)
Factory *factory = 0;
if ( !mSelves )
{
- mSelves = staticDeleter.setObject( new QDict<Factory> );
+ mSelves = staticDeleter.setObject( new Q3Dict<Factory> );
}
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 @@
#ifndef KRESOURCES_FACTORY_H
#define KRESOURCES_FACTORY_H
-#include <qdict.h>
+#include <q3dict.h>
#include <qstring.h>
#include <kconfig.h>
@@ -114,7 +114,7 @@ class Factory
Factory( const QString& resourceFamily);
private:
- static QDict<Factory> *mSelves;
+ static Q3Dict<Factory> *mSelves;
QString mResourceFamily;
//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 @@
*/
#include <qlayout.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3Frame>
//US #include <kaboutdata.h>
//US #include <kgenericfactory.h>
@@ -40,9 +43,9 @@ KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringLi
: KDialogBase( parent, name, true, i18n( "Configure Resources" ),
Ok|Cancel, Ok, true )
{
- QFrame *main = plainPage();
+ Q3Frame *main = plainPage();
- QVBoxLayout *layout = new QVBoxLayout( main );
+ Q3VBoxLayout *layout = new Q3VBoxLayout( main );
mConfigPage = new KRES::ConfigPage( main );
layout->addWidget( mConfigPage );
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$
#ifndef KRESOURCES_MANAGER_H
#define KRESOURCES_MANAGER_H
-#include <qdict.h>
+#include <q3dict.h>
#include <qstringlist.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include "factory.h"
#include "managerimpl.h"
@@ -175,7 +177,7 @@ class Manager : private ManagerImplListener
mImpl = new ManagerImpl( family );
mImpl->setListener( this );
- mListeners = new QPtrList<ManagerListener<T> >;
+ mListeners = new Q3PtrList<ManagerListener<T> >;
}
virtual ~Manager()
@@ -330,7 +332,7 @@ class Manager : private ManagerImplListener
private:
ManagerImpl *mImpl;
Factory *mFactory;
- QPtrList<ManagerListener<T> > *mListeners;
+ Q3PtrList<ManagerListener<T> > *mListeners;
};
}
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$
#include <kconfig.h>
#include <kstandarddirs.h>
#include <qfile.h>
+//Added by qt3to4:
+#include <Q3PtrList>
#include "resource.h"
#include "factory.h"
@@ -232,9 +234,9 @@ Resource::List *ManagerImpl::resourceList()
return &mResources;
}
-QPtrList<Resource> ManagerImpl::resources()
+Q3PtrList<Resource> ManagerImpl::resources()
{
- QPtrList<Resource> result;
+ Q3PtrList<Resource> result;
Resource::List::ConstIterator it;
for ( it = mResources.begin(); it != mResources.end(); ++it ) {
@@ -243,9 +245,9 @@ QPtrList<Resource> ManagerImpl::resources()
return result;
}
-QPtrList<Resource> ManagerImpl::resources( bool active )
+Q3PtrList<Resource> ManagerImpl::resources( bool active )
{
- QPtrList<Resource> result;
+ Q3PtrList<Resource> result;
Resource::List::ConstIterator it;
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$
#define KRESOURCES_MANAGERIMPL_H
#include <qstring.h>
-#include <qptrlist.h>
-#include <qdict.h>
+#include <q3ptrlist.h>
+#include <q3dict.h>
//US
#include <qobject.h>
@@ -81,10 +81,10 @@ class ManagerImpl : public QObject
Resource::List *resourceList();
- QPtrList<Resource> resources();
+ Q3PtrList<Resource> resources();
// Get only active or passive resources
- QPtrList<Resource> resources( bool active );
+ Q3PtrList<Resource> resources( bool active );
QStringList resourceNames();
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 @@
#include <qmutex.h>
#endif //QT_THREAD_SUPPORT
-#include <qvaluelist.h>
+#include <q3valuelist.h>
#include <qwidget.h>
#include <qobject.h>
@@ -239,7 +239,7 @@ class Resource : public QObject
Q_OBJECT
public:
- typedef QValueList<Resource *> List;
+ typedef Q3ValueList<Resource *> List;
/**
* 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 @@
//US
#include <kglobal.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qlayout.h>
-#include <qgroupbox.h>
+#include <q3groupbox.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
+#include <Q3Frame>
+#include <Q3PtrList>
#include "resource.h"
@@ -46,7 +50,7 @@ using namespace KRES;
//US I am using KBaseDialog instead of KDialog
//US : KDialog( parent, name, true )
-SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
+SelectDialog::SelectDialog( Q3PtrList<Resource> list, QWidget *parent,
const char *name )
: KDialogBase( parent, name, true, i18n( "Resource Selection" ), Help | Ok | Cancel,
Ok, true)
@@ -57,7 +61,7 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
resize( KMIN(KGlobal::getDesktopWidth(), 300), KMIN(KGlobal::getDesktopHeight(), 200) );
//US
- QFrame *main = plainPage();
+ Q3Frame *main = plainPage();
/*US
QVBoxLayout *layout = new QVBoxLayout( main );
mConfigPage = new KRES::ConfigPage( main );
@@ -65,15 +69,15 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
*/
//US QVBoxLayout *mainLayout = new QVBoxLayout( this );
- QVBoxLayout *mainLayout = new QVBoxLayout( main );
+ Q3VBoxLayout *mainLayout = new Q3VBoxLayout( main );
mainLayout->setMargin( marginHint() );
//US QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, this );
- QGroupBox *groupBox = new QGroupBox( 2, Qt::Horizontal, main );
+ Q3GroupBox *groupBox = new Q3GroupBox( 2, Qt::Horizontal, main );
groupBox->setTitle( i18n( "Resources" ) );
//US mResourceId = new KListBox( groupBox );
- mResourceId = new QListBox( groupBox );
+ mResourceId = new Q3ListBox( groupBox );
mainLayout->addWidget( groupBox );
@@ -101,7 +105,7 @@ SelectDialog::SelectDialog( QPtrList<Resource> list, QWidget *parent,
}
mResourceId->setCurrentItem( 0 );
- connect( mResourceId, SIGNAL(returnPressed(QListBoxItem*)),
+ connect( mResourceId, SIGNAL(returnPressed(Q3ListBoxItem*)),
SLOT(accept()) );
}
@@ -113,7 +117,7 @@ Resource *SelectDialog::resource()
return 0;
}
-Resource *SelectDialog::getResource( QPtrList<Resource> list, QWidget *parent )
+Resource *SelectDialog::getResource( Q3PtrList<Resource> list, QWidget *parent )
{
if ( list.count() == 0 ) {
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 @@
#define KRESOURCES_SELECTDIALOG_H
#include <qobject.h>
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <qmap.h>
#include <kdialogbase.h>
//US class KListBox;
-class QListBox;
+class Q3ListBox;
namespace KRES {
@@ -62,7 +62,7 @@ class SelectDialog : KDialogBase
* @param parent The parent widget
* @param name The name of the dialog
*/
- SelectDialog( QPtrList<Resource> list, QWidget *parent = 0,
+ SelectDialog( Q3PtrList<Resource> list, QWidget *parent = 0,
const char *name = 0);
// ~SelectDialog();
@@ -76,11 +76,11 @@ class SelectDialog : KDialogBase
* Open a dialog showing the available resources and return the resource the
* user has selected. Returns 0, if the dialog was canceled.
*/
- static Resource *getResource( QPtrList<Resource> list, QWidget *parent = 0 );
+ static Resource *getResource( Q3PtrList<Resource> list, QWidget *parent = 0 );
private:
//US KListBox *mResourceId;
- QListBox *mResourceId;
+ Q3ListBox *mResourceId;
QMap<int, Resource*> mResourceMap;
};