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) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkdepim | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
33 files changed, 432 insertions, 365 deletions
diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp index e2325d2..92a1737 100644 --- a/libkdepim/categoryeditdialog.cpp +++ b/libkdepim/categoryeditdialog.cpp @@ -18,45 +18,46 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qstringlist.h> #include <qlineedit.h> -#include <qlistview.h> -#include <qheader.h> +#include <q3listview.h> +#include <q3header.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include "kpimprefs.h" #include "categoryeditdialog.h" using namespace KPIM; CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, const char* name, bool modal, - WFlags fl ) + Qt::WFlags fl ) : CategoryEditDialog_base( parent, name, modal, fl ), mPrefs( prefs ) { mCategories->header()->hide(); QStringList::Iterator it; bool categoriesExist=false; for (it = mPrefs->mCustomCategories.begin(); it != mPrefs->mCustomCategories.end(); ++it ) { - new QListViewItem(mCategories,*it); + new Q3ListViewItem(mCategories,*it); categoriesExist=true; } - connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), - SLOT(editItem(QListViewItem *))); + connect(mCategories,SIGNAL(selectionChanged(Q3ListViewItem *)), + SLOT(editItem(Q3ListViewItem *))); connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); mButtonRemove->setEnabled(categoriesExist); mButtonModify->setEnabled(categoriesExist); #ifndef DESKTOP_VERSION mButtonOk->hide(); mButtonCancel->hide(); #endif mButtonAdd->setEnabled(!mEdit->text().isEmpty()); @@ -77,17 +78,17 @@ CategoryEditDialog::~CategoryEditDialog() void CategoryEditDialog::slotTextChanged(const QString &text) { mButtonAdd->setEnabled(!text.isEmpty()); } void CategoryEditDialog::add() { if (!mEdit->text().isEmpty()) { - new QListViewItem(mCategories,mEdit->text()); + new Q3ListViewItem(mCategories,mEdit->text()); mEdit->setText(""); mButtonRemove->setEnabled(mCategories->childCount()>0); mButtonModify->setEnabled(mCategories->childCount()>0); } } void CategoryEditDialog::remove() { @@ -116,26 +117,26 @@ void CategoryEditDialog::slotOk() slotApply(); QDialog::accept(); } void CategoryEditDialog::slotApply() { mPrefs->mCustomCategories.clear(); - QListViewItem *item = mCategories->firstChild(); + Q3ListViewItem *item = mCategories->firstChild(); while(item) { mPrefs->mCustomCategories.append(item->text(0)); item = item->nextSibling(); } mPrefs->writeConfig(); emit categoryConfigChanged(); } -void CategoryEditDialog::editItem(QListViewItem *item) +void CategoryEditDialog::editItem(Q3ListViewItem *item) { mEdit->setText(item->text(0)); mButtonRemove->setEnabled(true); mButtonModify->setEnabled(true); } //US #include "categoryeditdialog.moc" diff --git a/libkdepim/categoryeditdialog.h b/libkdepim/categoryeditdialog.h index 9bb3201..828894f 100644 --- a/libkdepim/categoryeditdialog.h +++ b/libkdepim/categoryeditdialog.h @@ -19,68 +19,68 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef KPIM_CATEGORYEDITDIALOG_H #define KPIM_CATEGORYEDITDIALOG_H #include <categoryeditdialog_base.h> -#include <qlistview.h> +#include <q3listview.h> class KPimPrefs; namespace KPIM { - class CategorySelectItem :public QObject, public QCheckListItem + class CategorySelectItem :public QObject, public Q3CheckListItem { Q_OBJECT public: - CategorySelectItem(QListView * parent, const QString & text, Type tt) : QObject( parent ), - QCheckListItem (parent, text, tt ) + CategorySelectItem(Q3ListView * parent, const QString & text, Type tt) : QObject( parent ), + Q3CheckListItem (parent, text, tt ) {;} signals: - void stateChanged( QListViewItem*); + void stateChanged( Q3ListViewItem*); protected: virtual void stateChange(bool b) { - QCheckListItem::stateChange(b); + Q3CheckListItem::stateChange(b); emit stateChanged( this ); } }; class CategoryEditDialog : public CategoryEditDialog_base { Q_OBJECT public: CategoryEditDialog( KPimPrefs *prefs, QWidget* parent = 0, const char* name = 0, - bool modal = FALSE, WFlags fl = 0 ); + bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategoryEditDialog(); public slots: void add(); void remove(); void modify(); void accept(); void slotOk(); void slotApply(); signals: void categoryConfigChanged(); private slots: - void editItem(QListViewItem *item); + void editItem(Q3ListViewItem *item); void slotTextChanged(const QString &text); - + private: KPimPrefs *mPrefs; }; } #endif diff --git a/libkdepim/categoryeditdialog_base.cpp b/libkdepim/categoryeditdialog_base.cpp index 1908576..c85f6e5 100644 --- a/libkdepim/categoryeditdialog_base.cpp +++ b/libkdepim/categoryeditdialog_base.cpp @@ -6,44 +6,48 @@ ** by: The User Interface Compiler () ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "categoryeditdialog_base.h" #include <qvariant.h> -#include <qheader.h> +#include <q3header.h> #include <qlineedit.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> /* * Constructs a CategoryEditDialog_base as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, true, fl ) { if ( !name ) setName( "CategoryEditDialog_base" ); - CategoryEditDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "CategoryEditDialog_baseLayout"); + CategoryEditDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "CategoryEditDialog_baseLayout"); mEdit = new QLineEdit( this, "mEdit" ); CategoryEditDialog_baseLayout->addMultiCellWidget( mEdit, 1, 1, 0, 0 ); - Layout13 = new QHBoxLayout( 0, 0, 6, "Layout13"); + Layout13 = new Q3HBoxLayout( 0, 0, 6, "Layout13"); // mButtonHelp = new QPushButton( this, "mButtonHelp" ); //mButtonHelp->setAutoDefault( TRUE ); //Layout13->addWidget( mButtonHelp ); //QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); //Layout13->addItem( spacer ); //mApply = new QPushButton( this, "mApply" ); @@ -55,22 +59,22 @@ CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* n Layout13->addWidget( mButtonOk ); mButtonCancel = new QPushButton( this, "mButtonCancel" ); mButtonCancel->setAutoDefault( TRUE ); Layout13->addWidget( mButtonCancel ); CategoryEditDialog_baseLayout->addMultiCellLayout( Layout13, 2, 2, 0, 1 ); - mCategories = new QListView( this, "mCategories" ); + mCategories = new Q3ListView( this, "mCategories" ); mCategories->addColumn( tr2i18n( "Category" ) ); CategoryEditDialog_baseLayout->addWidget( mCategories, 0, 0 ); - layout103 = new QVBoxLayout( 0, 0, 6, "layout103"); + layout103 = new Q3VBoxLayout( 0, 0, 6, "layout103"); mButtonAdd = new QPushButton( this, "mButtonAdd" ); CategoryEditDialog_baseLayout->addMultiCellWidget(mButtonAdd , 1, 1, 1, 1 ); //layout103->addWidget( mButtonAdd ); mButtonModify = new QPushButton( this, "mButtonModify" ); layout103->addWidget( mButtonModify ); diff --git a/libkdepim/categoryeditdialog_base.h b/libkdepim/categoryeditdialog_base.h index 5557ad0..cd577b0 100644 --- a/libkdepim/categoryeditdialog_base.h +++ b/libkdepim/categoryeditdialog_base.h @@ -7,52 +7,56 @@ ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef CATEGORYEDITDIALOG_BASE_H #define CATEGORYEDITDIALOG_BASE_H #include <qvariant.h> #include <qdialog.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> +#include <Q3HBoxLayout> + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; class QLineEdit; -class QListView; -class QListViewItem; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class CategoryEditDialog_base : public QDialog { Q_OBJECT public: - CategoryEditDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + CategoryEditDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategoryEditDialog_base(); QLineEdit* mEdit; QPushButton* mButtonHelp; QPushButton* mApply; QPushButton* mButtonOk; QPushButton* mButtonCancel; - QListView* mCategories; + Q3ListView* mCategories; QPushButton* mButtonAdd; QPushButton* mButtonModify; QPushButton* mButtonRemove; public slots: virtual void add(); virtual void modify(); virtual void slotApply(); virtual void remove(); virtual void slotOk(); protected: - QGridLayout* CategoryEditDialog_baseLayout; - QHBoxLayout* Layout13; - QVBoxLayout* layout103; + Q3GridLayout* CategoryEditDialog_baseLayout; + Q3HBoxLayout* Layout13; + Q3VBoxLayout* layout103; protected slots: virtual void languageChange(); }; #endif // CATEGORYEDITDIALOG_BASE_H diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp index 2a9b43e..4f72880 100644 --- a/libkdepim/categoryselectdialog.cpp +++ b/libkdepim/categoryselectdialog.cpp @@ -16,34 +16,37 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> -#include <qheader.h> -#include <qapp.h> +#include <q3header.h> +#include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <QPixmap> +#include <QDesktopWidget> #include <kmessagebox.h> #include "categoryeditdialog.h" #include "categoryselectdialog.h" #include "kpimprefs.h" using namespace KPIM; CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, const char* name, - bool modal, WFlags fl ) + bool modal, Qt::WFlags fl ) : CategorySelectDialog_base( parent, name, true, fl ), mPrefs( prefs ) { Q_UNUSED( modal ); mColorItem = 0; mColorEnabled = false; mCategories->header()->hide(); @@ -76,18 +79,18 @@ void CategorySelectDialog::setCategories() { mColorItem = 0; mCategories->clear(); mCategoryList.clear(); QStringList::Iterator it; for (it = mPrefs->mCustomCategories.begin(); it != mPrefs->mCustomCategories.end(); ++it ) { - CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox); - QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); + CategorySelectItem * item = new CategorySelectItem(mCategories,*it,Q3CheckListItem::CheckBox); + QObject::connect( item, SIGNAL( stateChanged(Q3ListViewItem *) ), this, SLOT( clicked(Q3ListViewItem *) ) ); } } CategorySelectDialog::~CategorySelectDialog() { } @@ -95,26 +98,26 @@ void CategorySelectDialog::setSelected(const QStringList &selList) { clear(); QStringList::ConstIterator it; QStringList notFound; bool found = false; for (it=selList.begin();it!=selList.end();++it) { //qDebug(" CategorySelectDialog::setSelected("); - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { if (item->text() == *it) { item->setOn(true); if ( ! found ) setColorItem( item ); found = true; break; } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } // if ( ! found ) { //emit updateCategoriesGlobal(); // QMessageBox::information( this, "KO/E: Information!", // "Categories found, which were not\n" // "in list of categories!\n" // "message", @@ -132,46 +135,46 @@ QStringList CategorySelectDialog::selectedCategories() const } void CategorySelectDialog::setColorEnabled() { mColorEnabled = true; mSetColorCat->show(); } void CategorySelectDialog::setColorCat() { - QCheckListItem * newColorItem = (QCheckListItem * )mCategories->currentItem (); + Q3CheckListItem * newColorItem = (Q3CheckListItem * )mCategories->currentItem (); if ( !newColorItem ) { KMessageBox::error(this,i18n("There is no current item.")); return; } if ( !newColorItem->isOn() ) newColorItem->setOn( true ); setColorItem( newColorItem ); } -void CategorySelectDialog::clicked ( QListViewItem * it ) +void CategorySelectDialog::clicked ( Q3ListViewItem * it ) { if ( ! it ) return; - QCheckListItem *i = (QCheckListItem *) it; + Q3CheckListItem *i = (Q3CheckListItem *) it; if ( !i->isOn() && i==mColorItem) { setColorItem( 0); - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { if (item->isOn()) { setColorItem( item ); break; } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } } else if ( i->isOn() && !mColorItem) { setColorItem( i); } } -void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem ) +void CategorySelectDialog::setColorItem( Q3CheckListItem * newColorItem ) { if ( !mColorEnabled ) return; if ( mColorItem == newColorItem) return; if ( mColorItem ) { mColorItem->setPixmap ( 0, QPixmap() ); mColorItem = 0; @@ -181,26 +184,26 @@ void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem ) pix.fill(Qt::red ); newColorItem->setPixmap ( 0, pix ); mColorItem = newColorItem; } } void CategorySelectDialog::slotApply() { QStringList categories; - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); QString colcat; while (item) { if (item->isOn()) { if ( item == mColorItem) colcat = item->text(); else categories.append(item->text()); } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } categories.sort(); if ( ! colcat.isEmpty() ) categories.prepend( colcat ); // QString categoriesStr = categories.join(","); mCategoryList = categories; @@ -215,32 +218,32 @@ void CategorySelectDialog::slotOk() slotApply(); emit categoriesSelected(mCategoryList); emit categoriesSelected(mCategoryList.join(",")); QDialog::accept(); } void CategorySelectDialog::clear() { - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { item->setOn(false); - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } } void CategorySelectDialog::updateCategoryConfig() { QStringList selected; - QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); + Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild(); while (item) { if (item->isOn()) { selected.append(item->text()); } - item = (QCheckListItem *)item->nextSibling(); + item = (Q3CheckListItem *)item->nextSibling(); } setCategories(); setSelected(selected); } //#include "categoryselectdialog.moc" diff --git a/libkdepim/categoryselectdialog.h b/libkdepim/categoryselectdialog.h index 680a093..ff7ac58 100644 --- a/libkdepim/categoryselectdialog.h +++ b/libkdepim/categoryselectdialog.h @@ -21,55 +21,55 @@ without including the source code for Qt in the source distribution. */ #ifndef KPIM_CATEGORYSELECTDIALOG_H #define KPIM_CATEGORYSELECTDIALOG_H #include <categoryselectdialog_base.h> class KPimPrefs; -class QCheckListItem; +class Q3CheckListItem; namespace KPIM { class CategorySelectDialog : public CategorySelectDialog_base { Q_OBJECT public: CategorySelectDialog( KPimPrefs *prefs, QWidget* parent = 0, const char* name = 0, - bool modal = FALSE, WFlags fl = 0 ); + bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategorySelectDialog(); void setCategories(); void setColorEnabled(); void setSelected(const QStringList &selList); QStringList selectedCategories() const; public slots: void slotOk(); void slotApply(); void clear(); void accept(); void editCategoriesDialog(); void updateCategoryConfig(); void setColorCat(); - void clicked ( QListViewItem * ); + void clicked ( Q3ListViewItem * ); signals: void categoriesSelected(const QString &); void categoriesSelected(const QStringList &); void editCategories(); private: bool mColorEnabled; KPimPrefs *mPrefs; QStringList mCategoryList; - QCheckListItem *mColorItem; - void setColorItem( QCheckListItem * ); + Q3CheckListItem *mColorItem; + void setColorItem( Q3CheckListItem * ); class CategorySelectDialogPrivate; CategorySelectDialogPrivate *d; }; } #endif diff --git a/libkdepim/categoryselectdialog_base.cpp b/libkdepim/categoryselectdialog_base.cpp index 4793fd7..5d53ac4 100644 --- a/libkdepim/categoryselectdialog_base.cpp +++ b/libkdepim/categoryselectdialog_base.cpp @@ -6,55 +6,58 @@ ** by: The User Interface Compiler () ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "categoryselectdialog_base.h" #include <qvariant.h> -#include <qheader.h> -#include <qlistview.h> +#include <q3header.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qlayout.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3HBoxLayout> /* * Constructs a CategorySelectDialog_base as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) +CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "CategorySelectDialog_base" ); - CategorySelectDialog_baseLayout = new QVBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout"); + CategorySelectDialog_baseLayout = new Q3VBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout"); - mCategories = new QListView( this, "mCategories" ); + mCategories = new Q3ListView( this, "mCategories" ); mCategories->addColumn( i18n( "Category" ) ); CategorySelectDialog_baseLayout->addWidget( mCategories ); mSetColorCat = new QPushButton( this, "msetColor" ); CategorySelectDialog_baseLayout->addWidget( mSetColorCat ); - Layout12 = new QHBoxLayout( 0, 0, 4, "Layout12"); + Layout12 = new Q3HBoxLayout( 0, 0, 4, "Layout12"); mClear = new QPushButton( this, "mClear" ); Layout12->addWidget( mClear ); // QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); //Layout12->addItem( spacer ); mButtonEdit = new QPushButton( this, "mButtonEdit" ); Layout12->addWidget( mButtonEdit ); CategorySelectDialog_baseLayout->addLayout( Layout12 ); - Layout11 = new QHBoxLayout( 0, 0, 4, "Layout11"); + Layout11 = new Q3HBoxLayout( 0, 0, 4, "Layout11"); //mButtonHelp = new QPushButton( this, "mButtonHelp" ); //Layout11->addWidget( mButtonHelp ); //QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); // Layout11->addItem( spacer_2 ); //mApply = new QPushButton( this, "mApply" ); // Layout11->addWidget( mApply ); diff --git a/libkdepim/categoryselectdialog_base.h b/libkdepim/categoryselectdialog_base.h index 59ffa22..71d4ce9 100644 --- a/libkdepim/categoryselectdialog_base.h +++ b/libkdepim/categoryselectdialog_base.h @@ -7,48 +7,52 @@ ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef CATEGORYSELECTDIALOG_BASE_H #define CATEGORYSELECTDIALOG_BASE_H #include <qvariant.h> #include <qdialog.h> - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QListView; -class QListViewItem; +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <Q3GridLayout> +#include <Q3HBoxLayout> + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class Q3ListView; +class Q3ListViewItem; class QPushButton; class CategorySelectDialog_base : public QDialog { Q_OBJECT public: - CategorySelectDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + CategorySelectDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~CategorySelectDialog_base(); - QListView* mCategories; + Q3ListView* mCategories; QPushButton* mClear; QPushButton* mButtonEdit; QPushButton* mButtonHelp; QPushButton* mApply; QPushButton* mButtonOk; QPushButton* mButtonCancel; QPushButton* mSetColorCat; public slots: virtual void clear(); virtual void slotApply(); virtual void slotOk(); protected: - QVBoxLayout* CategorySelectDialog_baseLayout; - QHBoxLayout* Layout12; - QHBoxLayout* Layout11; + Q3VBoxLayout* CategorySelectDialog_baseLayout; + Q3HBoxLayout* Layout12; + Q3HBoxLayout* Layout11; protected slots: virtual void languageChange(); }; #endif // CATEGORYSELECTDIALOG_BASE_H diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index f376e6c..3fc548a 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -34,17 +34,19 @@ $Id$ #include <qmap.h> #include <qregexp.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #include <qtopia/qcopenvelope_qws.h> #else #include <qapplication.h> -#include <qprocess.h> +#include <q3process.h> +//Added by qt3to4: +#include <Q3CString> #endif #include <kstaticdeleter.h> #include <kmessagebox.h> #include "externalapphandler.h" @@ -118,17 +120,17 @@ void QCopTransferItem::setSourceChannel(const QString& sourceChannel) { if ( !sourceChannel.isEmpty()) _sourceChannel = sourceChannel; } /*********************************************************************************/ -bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { // copied from old mail2 /* static int ii = 0; // block second call if ( ii < 2 ) { @@ -141,17 +143,17 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data */ // qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); //we are in the target and get a request from the source if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); QString sourceChannel; QString uid; QString param1; QString param2; QString param3; @@ -221,23 +223,23 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); return false; #endif } /*********************************************************************************/ -bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopMapTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { bool res = QCopTransferItem::appMessage( cmsg, data ); if (res == false) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); // qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); //we are in the source and get an answer from the target if ((_targetMessage + _targetMessageParameters) == cmsg.data()) { QMap<QString,QString> adrMap; QString uid; @@ -300,26 +302,26 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); return false; #endif } /*********************************************************************************/ -bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) +bool QCopListTransferItem::appMessage( const Q3CString& cmsg, const QByteArray& data ) { bool res = QCopTransferItem::appMessage( cmsg, data ); #ifdef DEBUG_EXT_APP_HANDLER qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); #endif if (res == false) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); #ifdef DEBUG_EXT_APP_HANDLER qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); #endif //we are in the source and get an answer from the target if ((_targetMessage + _targetMessageParameters) == cmsg.data()) { @@ -513,19 +515,19 @@ ExternalAppHandler *ExternalAppHandler::instance() void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) { DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() ); mDefaultItems.append(dai); } -QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) +Q3PtrList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) { - QList<DefaultAppItem> list; + Q3PtrList<DefaultAppItem> list; DefaultAppItem* dai; for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) { if (dai->_type == type) list.append(dai); } @@ -741,17 +743,17 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS //first check if one of the mailers need the emails right in the message. message2 = translateMessage(message2, emails, urls); #ifdef DEBUG_EXT_APP_HANDLER qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); #endif qDebug("%s --- %s %s --- %s %s", channel.latin1(), message.latin1(),message2.latin1(), parameters.latin1(), parameters2.latin1() ); //KMessageBox::sorry( 0, message2 ); - QProcess * proc = new QProcess( this ); + Q3Process * proc = new Q3Process( this ); int i = 0; proc->addArgument( channel ); if ( message.find (" " ) > 0 ) { QStringList list = QStringList::split( " ", message ); int i = 0; while ( i < list.count ( ) ) { //qDebug("add%sdd ",list[i].latin1() ); @@ -767,17 +769,17 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS parameters2 = translateMessage(parameters2, urls, "" ); QString arg = "to='%1'"; arg = arg.arg( emails ) + ","+parameters2;; //KMessageBox::sorry( 0,arg ); //qDebug("2add%sdd ",arg.latin1() ); proc->addArgument( arg); - proc->launch(""); + proc->launch(QString()); #endif return true; } /************************************************************************** * **************************************************************************/ @@ -826,17 +828,17 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e #ifndef DESKTOP_VERSION QCopEnvelope e(channel.latin1(), message.latin1()); //US we need no names in the To field. The emailadresses are enough passParameters(&e, parameters, name, emailadress); #else // DESKTOP_VERSION //KMessageBox::sorry( 0,channel ); - QProcess * proc = new QProcess( this ); + Q3Process * proc = new Q3Process( this ); proc->addArgument( channel ); if ( message.find (" " ) > 0 ) { QStringList list = QStringList::split( " ", message ); int i = 0; while ( i < list.count ( ) ) { //qDebug("add%sdd ",list[i].latin1() ); proc->addArgument( list[i] ); //KMessageBox::sorry( 0,list[i]); @@ -845,17 +847,17 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e } else { proc->addArgument(message ); } parameters = translateMessage(parameters, name, emailadress); //KMessageBox::information(0,parameters); proc->addArgument( parameters ); - proc->launch(""); + proc->launch(QString()); #endif return true; } /************************************************************************** * **************************************************************************/ @@ -1227,17 +1229,17 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete } /************************************************************************** * **************************************************************************/ -void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) +void ExternalAppHandler::appMessage( const Q3CString& cmsg, const QByteArray& data ) { qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this); if ( cmsg == "nextView()" ) { qDebug("nextView()"); QTimer::singleShot( 0, this, SIGNAL ( nextView() )); return; } if ( cmsg == "callContactdialog()" ) { diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index b899ad7..3247fe4 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h @@ -29,33 +29,36 @@ $Id$ */ #ifndef EXTERNALAPPHANDLER_H #define EXTERNALAPPHANDLER_H #include <qobject.h> #include <qlist.h> #include <qmap.h> +#include <Q3PtrList> +//Added by qt3to4: +#include <Q3CString> class QCopEnvelope; class ExternalAppHandler; class QCopTransferItem : public QObject { Q_OBJECT public: QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); QCopTransferItem(); bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null); void setSourceChannel(const QString& sourceChannel); - virtual bool appMessage( const QCString& msg, const QByteArray& data ); + virtual bool appMessage( const Q3CString& msg, const QByteArray& data ); signals: void receivedMessageFromSource(const QString& sourceChannel, const QString& uid); void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1); void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2); void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3); @@ -78,17 +81,17 @@ class QCopMapTransferItem : public QCopTransferItem { Q_OBJECT public: QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); - virtual bool appMessage( const QCString& msg, const QByteArray& data ); + virtual bool appMessage( const Q3CString& msg, const QByteArray& data ); signals: void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); }; /********************************************************************************* @@ -99,17 +102,17 @@ class QCopListTransferItem : public QCopTransferItem { Q_OBJECT public: QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); ~QCopListTransferItem(); bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); - virtual bool appMessage( const QCString& msg, const QByteArray& data ); + virtual bool appMessage( const Q3CString& msg, const QByteArray& data ); signals: void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6); }; /********************************************************************************* @@ -220,21 +223,21 @@ class ExternalAppHandler : public QObject const QStringList& birthdayList, const QStringList& anniversaryList, const QStringList& realNameList, const QStringList& emailList, const QStringList& assembledNameList, const QStringList& uidList); //loadConfig clears the cache and checks again if the applications are available or not void loadConfig(); - QList<DefaultAppItem> getAvailableDefaultItems(Types); + Q3PtrList<DefaultAppItem> getAvailableDefaultItems(Types); DefaultAppItem* getDefaultItem(Types, int); public slots: - void appMessage( const QCString& msg, const QByteArray& data ); + void appMessage( const Q3CString& msg, const QByteArray& data ); signals: void callContactdialog(); void nextView(); void doRingSync(); // Emmitted when the target app receives a request from the source app void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); @@ -257,17 +260,17 @@ class ExternalAppHandler : public QObject void receivedBirthdayListEvent(const QString& uid, const QStringList& birthdayList, const QStringList& anniversaryList, const QStringList& realNameList, const QStringList& emailList, const QStringList& assembledNameList, const QStringList& uidList); private: ExternalAppHandler(); - QList<DefaultAppItem> mDefaultItems; + Q3PtrList<DefaultAppItem> mDefaultItems; Availability mEmailAppAvailable; Availability mPhoneAppAvailable; Availability mFaxAppAvailable; Availability mSMSAppAvailable; Availability mPagerAppAvailable; Availability mSIPAppAvailable; diff --git a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp index 5094830..9f47766 100644 --- a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp +++ b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp @@ -25,16 +25,18 @@ Enhanced Version of the file for platform independent KDE tools. Copyright (c) 2004 Ulf Schenk $Id$ */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kdebug.h> //#include <klocale.h> //#include <stdlib.h> #include "kdepimconfigwidget.h" #include "kcmkdepimconfig.h" @@ -49,17 +51,17 @@ extern "C" } } #endif KCMKdePimConfig::KCMKdePimConfig(QWidget *parent, const char *name ) : KCModule( KPimGlobalPrefs::instance(), parent, name ) { //abort(); - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); mConfigWidget = new KDEPIMConfigWidget( (KPimGlobalPrefs*)getPreferences(), this, "KDEPIMConfigWidget" ); layout->addWidget( mConfigWidget ); layout->setSpacing( 0 ); layout->setMargin( 0 ); connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); } diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 292951b..11a2b45 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp @@ -26,26 +26,31 @@ Enhanced Version of the file for platform independent KDE tools. Copyright (c) 2004 Ulf Schenk $Id$ */ #include <qlayout.h> #include <qtabwidget.h> #include <qcombobox.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlineedit.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcheckbox.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qdir.h> #include <qregexp.h> #include <qspinbox.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3VBoxLayout> #include <kdialog.h> #include <kprefsdialog.h> #include <klocale.h> #include <kglobalsettings.h> #include <kdateedit.h> #include <kglobal.h> #include <stdlib.h> @@ -96,17 +101,17 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() ); tabWidget = new QTabWidget( this ); topLayout->addWidget( tabWidget ); setupLocaleTab(); setupLocaleDateTab(); @@ -116,45 +121,45 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, setupBackupTab(); } void KDEPIMConfigWidget::showTimeZoneTab() { tabWidget->setCurrentPage ( 3 ) ; } void KDEPIMConfigWidget::setupBackupTab() { - QVBox *colorPage = new QVBox( this ); + Q3VBox *colorPage = new Q3VBox( this ); tabWidget->addTab( colorPage, i18n( "Backup" ) ); QWidget* topFrame = new QWidget( colorPage ); - QVBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3VBoxLayout *topLayout = new Q3VBoxLayout(topFrame); KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); topLayout->addWidget((QWidget*)sb->checkBox()); QWidget* bupFrame = new QWidget( topFrame ); topLayout->addWidget((bupFrame)); QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); - QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); + Q3VBoxLayout *bupLayout = new Q3VBoxLayout(bupFrame); sb = addWidBool(i18n("Use standard backup dir"), &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); bupLayout->addWidget((QWidget*)sb->checkBox()); mBackupUrl = new KURLRequester( bupFrame ); mBackupUrl->setPathIsDir(); mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); bupLayout->addWidget( mBackupUrl ); mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); - QHBox *dummy = new QHBox(bupFrame); + Q3HBox *dummy = new Q3HBox(bupFrame); new QLabel(i18n("Number of Backups:"),dummy); mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); new QLabel(i18n(" "),dummy); bupLayout->addWidget( dummy ); - dummy = new QHBox(bupFrame); + dummy = new Q3HBox(bupFrame); new QLabel(i18n("Make backup every "),dummy); mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); new QLabel(i18n(" days"),dummy); new QLabel(i18n(" "),dummy); bupLayout->addWidget( dummy ); QString localKdeDir; localKdeDir = readEnvPath("LOCALMICROKDEHOME"); if ( ! localKdeDir.isEmpty() ) { @@ -162,28 +167,28 @@ void KDEPIMConfigWidget::setupBackupTab() sb->checkBox()->setChecked( true ); mBackupUrl->setEnabled( false ); KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; } } void KDEPIMConfigWidget::setupStoreTab() { - QVBox *colorPage = new QVBox( this ); + Q3VBox *colorPage = new Q3VBox( this ); tabWidget->addTab( colorPage, i18n( "Colors" ) ); QWidget* cw = new QWidget( colorPage ); KPrefsWidColor *holidayColor = addWidColor(i18n("Alternating background of list views"), &(KPimGlobalPrefs::instance()->mAlternateColor),cw); - QHBoxLayout *topLayout = new QHBoxLayout(cw); + Q3HBoxLayout *topLayout = new Q3HBoxLayout(cw); topLayout->addWidget(holidayColor->label()); topLayout->addWidget( (QWidget* )holidayColor->button()); - QVBox *storePage = new QVBox( this ); + Q3VBox *storePage = new Q3VBox( this ); if ( QApplication::desktop()->height() > 240 ) new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); mStoreUrl = new KURLRequester( storePage ); mStoreUrl->setPathIsDir(); mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); #ifdef DESKTOP_VERSION QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; @@ -195,17 +200,17 @@ void KDEPIMConfigWidget::setupStoreTab() if ( localKdeDir != "x_x_x" ) { mStoreUrl->setURL( localKdeDir ); qDebug("Reading config from %s ", confFile.latin1()); } } #endif new QLabel( i18n("New dirs are created automatically"), storePage ); - QHBox *bb = new QHBox( storePage ); + Q3HBox *bb = new Q3HBox( storePage ); QPushButton * pb; if ( QApplication::desktop()->width() < 640 ) pb = new QPushButton ( i18n("Save"), bb ); else pb = new QPushButton ( i18n("Save settings"), bb ); connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); pb = new QPushButton ( i18n("Save standard"), bb ); connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); @@ -265,33 +270,33 @@ void KDEPIMConfigWidget::saveStoreSettings() } else { mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); saveStoreSettings(); } } void KDEPIMConfigWidget::setupExternalAppTab() { QWidget *externalAppsPage = new QWidget( this ); - QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), + Q3VBoxLayout* layout = new Q3VBoxLayout( externalAppsPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); mExternalApps = new QComboBox( externalAppsPage ); QMap<ExternalAppHandler::Types, QString>::Iterator it; for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) mExternalApps->insertItem( it.data(), it.key() ); layout->addWidget( mExternalApps ); connect( mExternalApps, SIGNAL( activated( int ) ), this, SLOT (externalapp_changed( int ) ) ); - mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); - QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); + mExternalAppGroupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); + Q3GridLayout *boxLayout = new Q3GridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); mExternalAppGroupBox->layout()->setMargin(4); mClient = new QComboBox( mExternalAppGroupBox ); boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); connect( mClient, SIGNAL( activated( int ) ), this, SLOT (client_changed( int ) ) ); @@ -347,17 +352,17 @@ void KDEPIMConfigWidget::setupExternalAppTab() tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); } void KDEPIMConfigWidget::setupLocaleDateTab() { QWidget *topFrame = new QWidget( this ); - QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); + Q3GridLayout *topLayout = new Q3GridLayout( topFrame, 3, 2); topLayout->setSpacing(KDialog::spacingHintSmall()); topLayout->setMargin(KDialog::marginHintSmall()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); @@ -415,17 +420,17 @@ void KDEPIMConfigWidget::setupLocaleDateTab() tabWidget->addTab( topFrame, i18n( "Date Format" ) ); } void KDEPIMConfigWidget::setupLocaleTab() { QWidget *topFrame = new QWidget( this ); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(KDialog::spacingHint()); topLayout->setMargin(KDialog::marginHint()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); syncPrefsGroup->addRadio(i18n("English")); syncPrefsGroup->addRadio(i18n("German")); @@ -437,17 +442,17 @@ void KDEPIMConfigWidget::setupLocaleTab() syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); } topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; tabWidget->addTab( topFrame, i18n( "Language" ) ); topFrame = new QWidget( this ); - topLayout = new QGridLayout(topFrame,4,2); + topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(KDialog::spacingHint()); topLayout->setMargin(KDialog::marginHint()); iii = 0; syncPrefsGroup = addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); if ( QApplication::desktop()->width() > 300 ) syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); @@ -466,29 +471,29 @@ void KDEPIMConfigWidget::setupLocaleTab() tabWidget->addTab( topFrame, i18n( "Time Format" ) ); } void KDEPIMConfigWidget::setupTimeZoneTab() { QWidget *topFrame; - QGridLayout *topLayout ; + Q3GridLayout *topLayout ; topFrame = new QWidget( this ); - topLayout = new QGridLayout( topFrame, 5, 2); + topLayout = new Q3GridLayout( topFrame, 5, 2); topLayout->setSpacing(KDialog::spacingHintSmall()); topLayout->setMargin(KDialog::marginHintSmall()); - QHBox *timeZoneBox = new QHBox( topFrame ); + Q3HBox *timeZoneBox = new Q3HBox( topFrame ); topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); new QLabel( i18n("Timezone:"), timeZoneBox ); mTimeZoneCombo = new QComboBox( timeZoneBox ); if ( QApplication::desktop()->width() < 300 ) { mTimeZoneCombo->setMaximumWidth(150); } @@ -545,17 +550,17 @@ void KDEPIMConfigWidget::setupTimeZoneTab() connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); topFrame = new QWidget( this ); - topLayout = new QGridLayout( topFrame, 3, 2); + topLayout = new Q3GridLayout( topFrame, 3, 2); topLayout->setSpacing(KDialog::spacingHintSmall()); topLayout->setMargin(KDialog::marginHintSmall()); tabWidget->addTab( topFrame, i18n( "Fonts" ) ); QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); topLayout->addMultiCellWidget(labb,0,0,0,2); int i = 1; KPrefsWidFont *timeLabelsFont = @@ -706,17 +711,17 @@ void KDEPIMConfigWidget::updateClientWidgets() return; // update group box mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); //update the entries in the client combobox mClient->clear(); - QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); + Q3PtrList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); DefaultAppItem* dai; for ( dai=items.first(); dai != 0; dai=items.next() ) { mClient->insertItem( i18n(dai->_label), dai->_id ); if (dai->_id == mCurrentClient) { //restore the edit fields with the data of the local membervariables if we had set it to "other". diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index 824ef79..d693015 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h @@ -29,24 +29,26 @@ $Id$ */ #ifndef KDEPIMCONFIGWIDGET_H #define KDEPIMCONFIGWIDGET_H #include <kprefswidget.h> #include <kio/kfile/kurlrequester.h> #include <qmap.h> +//Added by qt3to4: +#include <QLabel> #include "externalapphandler.h" class QComboBox; class QLineEdit; class KPimGlobalPrefs; -class QGroupBox; +class Q3GroupBox; class QTabWidget; class KDateEdit; class KDEPIMConfigWidget : public KPrefsWidget { Q_OBJECT public: @@ -101,17 +103,17 @@ class KDEPIMConfigWidget : public KPrefsWidget // void saveExtensionSettings(); // KListView *mExtensionView; // QCheckBox *mNameParsing; // QCheckBox *mViewsSingleClickBox; // QPushButton *mConfigureButton; QComboBox* mExternalApps; - QGroupBox* mExternalAppGroupBox; + Q3GroupBox* mExternalAppGroupBox; QComboBox* mClient; QLineEdit* mChannel; QLineEdit* mMessage; QLineEdit* mParameters; QLineEdit* mMessage2; QLineEdit* mParameters2; diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index bf38479..28c88d4 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -22,31 +22,35 @@ without including the source code for Qt in the source distribution. */ #include <qapplication.h> #include <qevent.h> #include <qlineedit.h> #include <qpixmap.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3Frame> +#include <QKeyEvent> #include <kdatepicker.h> #include <kdebug.h> #include <kglobal.h> #include <kiconloader.h> #include <klocale.h> #include <kmessagebox.h> #include <knotifyclient.h> #include <qpalette.h> +#include <QDesktopWidget> #include "kdateedit.h" //#include "kdateedit.moc" KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) - : QHBox(parent, name) + : Q3HBox(parent, name) { dateFormShort = true; withoutDp = withoutDP; mDateEdit = new QLineEdit(this); mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort)); setFocusProxy(mDateEdit); mDateEdit->installEventFilter(this); @@ -67,31 +71,31 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) } else { QPixmap pixmap = SmallIcon("smallcal"); mDateButton = new QPushButton(this); mDateButton->setPixmap(pixmap); QPixmap pixmap2 = SmallIcon("today_small"); QPushButton* nowButton = new QPushButton(this); nowButton->setPixmap(pixmap2); - mDateFrame = new QVBox(0,0,WType_Popup); + mDateFrame = new Q3VBox(0,0,Qt::WType_Popup); // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); - mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); + mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised ); mDateFrame->setLineWidth(3); mDateFrame->hide(); mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate()); connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); connect(nowButton,SIGNAL(clicked()),SLOT(goToNow())); - mDateButton->setFocusPolicy( QWidget::NoFocus ); + mDateButton->setFocusPolicy( Qt::NoFocus ); mDateButton->setAutoDefault( false ); //mDateFrame->resize( 400, 300 ); } connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); connect(mDateEdit,SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &))); @@ -220,45 +224,45 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm begin = dateForm.find("%", begin +1); } // set date switch ( dateForm.at(begin + 1).latin1() ) { case 'd': case 'a': case 'A': - if(key == Key_Up) { + if(key == Qt::Key_Up) { setDate( date.addDays( 1 ) ); } - else if(key == Key_Down) { + else if(key == Qt::Key_Down) { setDate( date.addDays( -1 ) ); } maxDay = readDate().day(); break; case 'm': case 'b': case 'B': - if(key == Key_Up) { + if(key == Qt::Key_Up) { int year = ((date.month()+1)>12)?date.year()+1:date.year(); int month = ((date.month()+1)>12)?1:date.month()+1; int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay; setDate( QDate( year, month, day ) ); - } else if(key == Key_Down) { + } else if(key == Qt::Key_Down) { int year = ((date.month()-1)<1)?date.year()-1:date.year(); int month = ((date.month()-1)<1)?12:date.month()-1; int day = (QDate(year,month,1).daysInMonth()<maxDay)?QDate(year,month,1).daysInMonth():maxDay; setDate( QDate( year, month, day ) ); } break; case 'y': case 'Y': - if(key == Key_Up) { + if(key == Qt::Key_Up) { setDate( QDate( date.year() + 1, date.month() , date.day()) ); } - else if(key == Key_Down) { + else if(key == Qt::Key_Down) { setDate( QDate( date.year() - 1, date.month() , date.day()) ); } break; /* default: if(key == Key_Up) { setDate( date.addDays( 1 ) ); } else if(key == Key_Down) { setDate( date.addDays( -1 ) ); @@ -339,49 +343,49 @@ QDate KDateEdit::date() const void KDateEdit::keyPressEvent(QKeyEvent *e) { QDate date = readDate(); int cpos = mDateEdit->cursorPosition(); switch(e->key()) { - case Key_Escape: + case Qt::Key_Escape: mDateEdit->deselect(); - case Key_Tab: - QHBox::keyPressEvent(e); + case Qt::Key_Tab: + Q3HBox::keyPressEvent(e); break; - case Key_Up: + case Qt::Key_Up: // when date invalid then set to currend and return if(!date.isValid()) { date = QDate::currentDate(); setDate(date); mDateEdit->setCursorPosition(cpos); emit(dateChanged(date)); QString text = i18n( "You entered an invalid date!\n Date changed to current date." ); KMessageBox::information( 0, text ); return; } - setDate(date, &cpos, Key_Up, dateFormShort); + setDate(date, &cpos, Qt::Key_Up, dateFormShort); break; - case Key_Down: + case Qt::Key_Down: // when date invalid then set to current and return if(!date.isValid()) { date = QDate::currentDate(); setDate(date); mDateEdit->setCursorPosition(cpos); emit(dateChanged(date)); QString text = i18n( "You entered an invalid date!\n Date changed to current date." ); KMessageBox::information( 0, text ); return; } - setDate(date, &cpos, Key_Down, dateFormShort); + setDate(date, &cpos, Qt::Key_Down, dateFormShort); break; default: - QHBox::keyPressEvent(e); + Q3HBox::keyPressEvent(e); break; } // switch mDateEdit->setCursorPosition(cpos); } void KDateEdit::setSelect( int from, int to ) { // return; diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h index 2d8c452..38eacde 100644 --- a/libkdepim/kdateedit.h +++ b/libkdepim/kdateedit.h @@ -19,20 +19,23 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef KDATEEDIT_H #define KDATEEDIT_H -#include <qhbox.h> -#include <qvbox.h> +#include <q3hbox.h> +#include <q3vbox.h> #include <qdatetime.h> #include <qmap.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <QEvent> class QLineEdit; class QPushButton; class QObject; class QEvent; class KDatePicker; class KDateValidator; @@ -44,17 +47,17 @@ class KDateValidator; * This widget also supports advanced features like allowing the user * to type in the day name to get the date. The following keywords * are supported (in the native language): tomorrow, yesturday, today, * monday, tuesday, wednesday, thursday, friday, saturday, sunday. * * @author Cornelius Schumacher <schumacher@kde.org> * @author Mike Pilone <mpilone@slac.com> */ -class KDateEdit : public QHBox +class KDateEdit : public Q3HBox { Q_OBJECT public: KDateEdit(QWidget *parent=0, const char *name=0, bool withoutDP = false ); virtual ~KDateEdit(); /** @return True if the date in the text edit is valid, * false otherwise. This will not modify the display of the date, @@ -123,17 +126,17 @@ class KDateEdit : public QHBox */ QMap<QString, int> mKeywordMap; bool mTextChanged; bool mHandleInvalid; QPushButton *mDateButton; QLineEdit *mDateEdit; KDatePicker *mDatePicker; - QVBox *mDateFrame; + Q3VBox *mDateFrame; int maxDay; bool withoutDp; protected: virtual void keyPressEvent(QKeyEvent *qke); void setSelect ( int, int ); bool dateFormShort; char lengthMonthName; diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 68ef943..28b65cf 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp @@ -18,34 +18,38 @@ Boston, MA 02111-1307, USA. */ #include "kdatepicker.h" #include <kglobal.h> #include <kapplication.h> #include <klocale.h> #include <kiconloader.h> -#include <qframe.h> +#include <q3frame.h> #include <qpainter.h> #include <qdialog.h> #include <qtoolbutton.h> #include <qfont.h> #include <qapplication.h> #include <qlineedit.h> #include <qvalidator.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QKeyEvent> +#include <QDesktopWidget> #include <kdebug.h> #include <knotifyclient.h> #include <kglobalsettings.h> #include "kdatetbl.h" #include "kdateedit.h" //#include "kdatepicker.moc" KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) - : QFrame(parent,name), + : Q3Frame(parent,name), yearForward(new QToolButton(this)), yearBackward(new QToolButton(this)), monthForward(new QToolButton(this)), monthBackward(new QToolButton(this)), selectMonth(new QToolButton(this)), selectYear(new QToolButton(this)), todayBut(new QToolButton(this)), //line(new QLineEdit(this)), diff --git a/libkdepim/kdatepicker.h b/libkdepim/kdatepicker.h index 3db9a89..4d904da 100644 --- a/libkdepim/kdatepicker.h +++ b/libkdepim/kdatepicker.h @@ -15,18 +15,21 @@ You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef MICROKDE_KDATEPICKER_H #define MICROKDE_KDATEPICKER_H #include <qdatetime.h> -#include <qframe.h> +#include <q3frame.h> #include <qevent.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QKeyEvent> class QLineEdit; class QToolButton; class KDateValidator; class KDateTable; class KDateEdit; /** @@ -43,17 +46,17 @@ class KDateEdit; * * @image kdatepicker.png KDatePicker * * @version $Id$ * @author Tim Gilman, Mirko Boehm * * @short A date selection widget. **/ -class KDatePicker: public QFrame +class KDatePicker: public Q3Frame { Q_OBJECT public: /** The usual constructor. The given date will be displayed * initially. **/ KDatePicker(QWidget *parent=0, QDate=QDate::currentDate(), diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 9c28425..3677e87 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp @@ -33,17 +33,17 @@ $Id$ #include <klocale.h> #include <kdebug.h> #include <kglobalsettings.h> #include <kstaticdeleter.h> #include <qregexp.h> #include <qfile.h> #include <stdlib.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qapplication.h> #include "kpimglobalprefs.h" KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP; KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) @@ -137,33 +137,33 @@ void KPimGlobalPrefs::setGlobalConfig() fileName = fileName+"germantranslation.txt"; else if ( mPreferredLanguage == 4 ) fileName = fileName+"usertranslation.txt"; else if ( mPreferredLanguage == 2 ) fileName = fileName+"frenchtranslation.txt"; else if ( mPreferredLanguage == 3 ) fileName = fileName+"italiantranslation.txt"; QFile file( fileName ); - if (file.open( IO_ReadOnly ) ) { - QTextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); + if (file.open( QIODevice::ReadOnly ) ) { + Q3TextStream ts( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); //ts.setCodec( QTextCodec::latin1 ); QString text = ts.read(); file.close(); text.replace( QRegExp("\\\\n"), "\n" ); QString line; QString we; QString wt; int br = 0; int nbr; nbr = text.find ( "},", br ); line = text.mid( br, nbr - br ); br = nbr+1; int se, ee, st, et; - mLocaleDict = new QDict<QString>; + mLocaleDict = new Q3Dict<QString>; mLocaleDict->setAutoDelete( true ); QString end = "{ \"\",\"\" }"; while ( (line != end) && (br > 1) ) { //qDebug("%d *%s* ", br, line.latin1()); se = line.find("\"")+1; et = line.findRev("\"",-1); ee = line.find("\",\""); st = ee+3; diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index 94ac8ae..01f5ab0 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h @@ -27,17 +27,17 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ #ifndef KPIMGLOBALPREFS_H #define KPIMGLOBALPREFS_H #include "kprefs.h" -#include <qdict.h> +#include <q3dict.h> class KPimGlobalPrefs : public KPrefs { public: void setGlobalConfig(); static KPimGlobalPrefs *instance(); @@ -80,17 +80,17 @@ class KPimGlobalPrefs : public KPrefs OTHER_SIC = 1, KPPI_SIC = 2 }; private: KPimGlobalPrefs( const QString &name = QString::null ); static KPimGlobalPrefs *sInstance; - QDict<QString> *mLocaleDict; + Q3Dict<QString> *mLocaleDict; public: //US I copied the following "locale" settings from KOPrefs int mPreferredDate; QString mUserDateFormatLong; QString mUserDateFormatShort; int mPreferredLanguage; diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index 6dc741d..358acbd 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp @@ -20,33 +20,34 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ // $Id$ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> -#include <qtextstream.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3textstream.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qspinbox.h> #include <qdatetime.h> -#include <qframe.h> +#include <q3frame.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include <kcolorbutton.h> #include <kdebug.h> #include <klocale.h> #include <kglobal.h> #include <kglobalsettings.h> #include <kfontdialog.h> #include <kmessagebox.h> @@ -123,17 +124,17 @@ KColorButton *KPrefsDialogWidColor::button() KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString &labelText, QFont *reference,QWidget *parent) { mReference = reference; mLabel = new QLabel(labelText, parent); mPreview = new QLabel(sampleText,parent); - mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); + mPreview->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); mButton = new QPushButton(i18n("Choose..."), parent); connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); } KPrefsDialogWidFont::~KPrefsDialogWidFont() @@ -207,29 +208,29 @@ QSpinBox *KPrefsDialogWidTime::spinBox() } KPrefsDialogWidRadios::KPrefsDialogWidRadios(const QString &text,int *reference, QWidget *parent) { mReference = reference; - mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); + mBox = new Q3ButtonGroup(1,Qt::Horizontal,text,parent); } KPrefsDialogWidRadios::~KPrefsDialogWidRadios() { } void KPrefsDialogWidRadios::addRadio(const QString &text) { new QRadioButton(text,mBox); } -QButtonGroup *KPrefsDialogWidRadios::groupBox() +Q3ButtonGroup *KPrefsDialogWidRadios::groupBox() { return mBox; } void KPrefsDialogWidRadios::readConfig() { mBox->setButton(*mReference); } diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index 52ec809..cc95dd4 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h @@ -19,29 +19,31 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef _KPREFSDIALOG_H #define _KPREFSDIALOG_H // $Id$ -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qlineedit.h> +//Added by qt3to4: +#include <QLabel> #include <kdialogbase.h> class KPrefs; class KPrefsDialog; class KColorButton; class QCheckBox; class QLabel; class QSpinBox; -class QButtonGroup; +class Q3ButtonGroup; /** @short Base class for widgets used by @ref KPrefsDialog. @author Cornelius Schumacher @see KPrefsDialog This class provides the interface for the preferences widgets used by KPrefsDialog. @@ -253,25 +255,25 @@ class KPrefsDialogWidRadios : public KPrefsDialogWid @param text Text of the button. */ void addRadio(const QString &text); /** Return the box widget used by this widget. */ - QButtonGroup *groupBox(); + Q3ButtonGroup *groupBox(); void readConfig(); void writeConfig(); private: int *mReference; - QButtonGroup *mBox; + Q3ButtonGroup *mBox; }; /** @short Widget for string settings in @ref KPrefsDialog. This class provides a widget for configuring string values. It is meant to be used by KPrefsDialog. The user is responsible for the layout management. @@ -434,17 +436,17 @@ class KPrefsDialog : public KDialogBase /** Implement this to read custom configuration widgets. */ virtual void usrReadConfig() {} /** Implement this to write custom configuration widgets. */ virtual void usrWriteConfig() {} private: KPrefs *mPrefs; - QPtrList<KPrefsDialogWid> mPrefsWids; + Q3PtrList<KPrefsDialogWid> mPrefsWids; }; #include "kcmconfigs/kdepimconfigwidget.h" class KPimPrefsGlobalDialog : public KPrefsDialog { Q_OBJECT public: diff --git a/libkdepim/kprefswidget.cpp b/libkdepim/kprefswidget.cpp index f6a0b38..51431e2 100644 --- a/libkdepim/kprefswidget.cpp +++ b/libkdepim/kprefswidget.cpp @@ -20,33 +20,34 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ // $Id$ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> -#include <qtextstream.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3textstream.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qspinbox.h> #include <qdatetime.h> -#include <qframe.h> +#include <q3frame.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include <kcolorbutton.h> #include <kdebug.h> #include <klocale.h> #include <kglobal.h> #include <kfontdialog.h> #include <kmessagebox.h> #include <kcolordialog.h> @@ -126,17 +127,17 @@ KColorButton *KPrefsWidColor::button() KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText, QFont *reference,QWidget *parent) { mReference = reference; mLabel = new QLabel(labelText, parent); mPreview = new QLabel(sampleText,parent); - mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); + mPreview->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); mButton = new QPushButton(i18n("Choose..."), parent); connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); } KPrefsWidFont::~KPrefsWidFont() @@ -213,30 +214,30 @@ QSpinBox *KPrefsWidTime::spinBox() } KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference, QWidget *parent) { mReference = reference; - mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); + mBox = new Q3ButtonGroup(1,Qt::Horizontal,text,parent); connect( mBox, SIGNAL( clicked(int)), SIGNAL( modified() ) ); } KPrefsWidRadios::~KPrefsWidRadios() { } void KPrefsWidRadios::addRadio(const QString &text) { new QRadioButton(text,mBox); } -QButtonGroup *KPrefsWidRadios::groupBox() +Q3ButtonGroup *KPrefsWidRadios::groupBox() { return mBox; } void KPrefsWidRadios::readConfig() { mBox->setButton(*mReference); } diff --git a/libkdepim/kprefswidget.h b/libkdepim/kprefswidget.h index 8543a39..9de1be5 100644 --- a/libkdepim/kprefswidget.h +++ b/libkdepim/kprefswidget.h @@ -20,29 +20,31 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ // $Id$ #ifndef _KPREFSWIDGET_H #define _KPREFSWIDGET_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qwidget.h> +//Added by qt3to4: +#include <QLabel> class KPrefs; class KColorButton; class QCheckBox; class QLabel; class QSpinBox; -class QButtonGroup; +class Q3ButtonGroup; /** @short Base class for widgets used by @ref KPrefsDialog. @author Cornelius Schumacher @see KPrefsDialog This class provides the interface for the preferences widgets used by KPrefsDialog. @@ -260,25 +262,25 @@ class KPrefsWidRadios : public KPrefsWid @param text Text of the button. */ void addRadio(const QString &text); /** Return the box widget used by this widget. */ - QButtonGroup *groupBox(); + Q3ButtonGroup *groupBox(); void readConfig(); void writeConfig(); private: int *mReference; - QButtonGroup *mBox; + Q3ButtonGroup *mBox; }; /** @short Widget for string settings in @ref KPrefsDialog. This class provides a widget for configuring string values. It is meant to be used by KPrefsDialog. The user is responsible for the layout management. @@ -444,12 +446,12 @@ class KPrefsWidget : public QWidget /** Implement this to read custom configuration widgets. */ virtual void usrReadConfig() {} /** Implement this to write custom configuration widgets. */ virtual void usrWriteConfig() {} private: KPrefs *mPrefs; - QPtrList<KPrefsWid> mPrefsWids; + Q3PtrList<KPrefsWid> mPrefsWids; }; #endif diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 5708dfc..c844627 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -30,45 +30,48 @@ #include "ksyncprofile.h" #include "ksyncprefsdialog.h" #include "kpimprefs.h" #include <kmessagebox.h> #include <qdir.h> -#include <qprogressbar.h> -#include <qpopupmenu.h> +#include <q3progressbar.h> +#include <q3popupmenu.h> #include <qpushbutton.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qtimer.h> #include <qmessagebox.h> #include <qapplication.h> #include <qlineedit.h> #include <qdialog.h> #include <qlayout.h> #include <qtextcodec.h> #include <qlabel.h> #include <qcheckbox.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <klocale.h> #include <kglobal.h> #include <kconfig.h> #include <kfiledialog.h> QDateTime KSyncManager::mRequestedSyncEvent; -KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) +KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, Q3PopupMenu* syncmenu) : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) { mServerSocket = 0; - bar = new QProgressBar ( 1, 0 ); + bar = new Q3ProgressBar ( 1, 0 ); bar->setCaption (""); mWriteBackInPast = 2; } KSyncManager::~KSyncManager() { @@ -84,17 +87,17 @@ void KSyncManager::setDefaultFileName( QString s) void KSyncManager::fillSyncMenu() { if ( mSyncMenu->count() ) mSyncMenu->clear(); mSyncMenu->insertItem( i18n("Configure..."), 0 ); mSyncMenu->insertSeparator(); - QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); + Q3PopupMenu *clearMenu = new Q3PopupMenu ( mSyncMenu ); mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); clearMenu->insertItem( i18n("For all profiles"), 1 ); clearMenu->insertSeparator(); connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); mSyncMenu->insertSeparator(); if ( mServerSocket == 0 ) { mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); } else { @@ -350,17 +353,17 @@ void KSyncManager::slotSyncMenu( int action ) void KSyncManager::enableQuick( bool ask ) { bool autoStart; bool changed = false; if ( ask ) { QDialog dia ( 0, "input-dialog", true ); QLineEdit lab ( &dia ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lab.setText( mPrefs->mPassiveSyncPort ); lay.setMargin(7); lay.setSpacing(7); int po = 9197+mTargetApp; QLabel label ( i18n("Port number (Default: %1)\nValid range from 1 to 65535").arg(po), &dia ); lay.addWidget( &label); lay.addWidget( &lab); @@ -799,17 +802,17 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask) } } return; } bool KSyncManager::edit_pisync_options() { QDialog dia( mParent, "dia", true ); dia.setCaption( i18n("Pi-Sync options for device: " ) +mCurrentSyncDevice ); - QVBoxLayout lay ( &dia ); + Q3VBoxLayout lay ( &dia ); lay.setSpacing( 5 ); lay.setMargin( 3 ); QLabel lab1 ( i18n("Password for remote access:"), &dia); lay.addWidget( &lab1 ); QLineEdit le1 (&dia ); lay.addWidget( &le1 ); QLabel lab2 ( i18n("Remote IP address:"), &dia); lay.addWidget( &lab2 ); @@ -833,18 +836,18 @@ bool KSyncManager::edit_pisync_options() } return false; } bool KSyncManager::edit_sync_options() { QDialog dia( mParent, "dia", true ); dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); - QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); - QVBoxLayout lay ( &dia ); + Q3ButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); + Q3VBoxLayout lay ( &dia ); lay.setSpacing( 2 ); lay.setMargin( 3 ); lay.addWidget(&gr); QRadioButton loc ( i18n("Take local entry on conflict"), &gr ); QRadioButton rem ( i18n("Take remote entry on conflict"), &gr ); QRadioButton newest( i18n("Take newest entry on conflict"), &gr ); QRadioButton ask( i18n("Ask for every entry on conflict"), &gr ); QRadioButton f_loc( i18n("Force: Take local entry always"), &gr ); @@ -886,17 +889,17 @@ bool KSyncManager::edit_sync_options() } QString KSyncManager::getPassword( ) { QString retfile = ""; QDialog dia ( mParent, "input-dialog", true ); QLineEdit lab ( &dia ); lab.setEchoMode( QLineEdit::Password ); - QVBoxLayout lay( &dia ); + Q3VBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); lay.addWidget( &lab); dia.setFixedSize( 230,50 ); dia.setCaption( i18n("Enter password") ); QPushButton pb ( "OK", &dia); lay.addWidget( &pb ); connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); @@ -1329,33 +1332,33 @@ void KSyncManager::readFileFromSocket() else { commandSocket->sendStop(); if ( syncOK ) mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); mPisyncFinished = true; } } -KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) +KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : Q3ServerSocket( port, backlog, parent, name ) { mPendingConnect = 0; mPassWord = pw; mSocket = 0; mSyncActionDialog = 0; blockRC = false; mErrorMessage = 0; } void KServerSocket::waitForSocketFinish() { if ( mSocket ) { //qDebug("KSS:: waiting for finish operation"); QTimer::singleShot( 250, this , SLOT ( waitForSocketFinish())); return; } - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); mSocket->setSocket( mPendingConnect ); mPendingConnect = 0; } void KServerSocket::newConnection ( int socket ) { // qDebug("KServerSocket:New connection %d ", socket); @@ -1367,17 +1370,17 @@ void KServerSocket::newConnection ( int socket ) mPendingConnect = socket; QTimer::singleShot( 250, this , SLOT ( waitForSocketFinish())); return; qDebug("KSS::newConnection Socket deleted! "); delete mSocket; mSocket = 0; } mPendingConnect = 0; - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); mSocket->setSocket( socket ); } void KServerSocket::discardClient() { QTimer::singleShot( 10, this , SLOT ( deleteSocket())); @@ -1457,21 +1460,21 @@ void KServerSocket::displayErrorMessage() } else if ( mErrorMessage == 2 ) { KMessageBox::error( 0, i18n("Got receive file request\nwith invalid password"), i18n("Pi-Sync Error")); mErrorMessage = 0; } } void KServerSocket::error_connect( QString errmess ) { - QTextStream os( mSocket ); - os.setEncoding( QTextStream::Latin1 ); + Q3TextStream os( mSocket ); + os.setEncoding( Q3TextStream::Latin1 ); os << errmess ; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) { + if ( mSocket->state() == Q3Socket::Idle ) { QTimer::singleShot( 0, this , SLOT ( discardClient())); } } void KServerSocket::end_connect() { delete mSyncActionDialog; mSyncActionDialog = 0; } @@ -1479,17 +1482,17 @@ void KServerSocket::send_file() { //qDebug("MainWindow::sendFile(QSocket* s) "); if ( mSyncActionDialog ) delete mSyncActionDialog; mSyncActionDialog = new QDialog ( 0, "input-dialog", true ); mSyncActionDialog->setCaption(i18n("Received sync request")); QLabel* label = new QLabel( i18n("Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog."), mSyncActionDialog ); label->setAlignment ( Qt::AlignHCenter ); - QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); + Q3VBoxLayout* lay = new Q3VBoxLayout( mSyncActionDialog ); lay->addWidget( label); lay->setMargin(7); lay->setSpacing(7); if ( KSyncManager::mRequestedSyncEvent.isValid() ) { int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent ); //secs = 333; if ( secs < 0 ) secs = secs * (-1); @@ -1531,37 +1534,37 @@ void KServerSocket::send_file() mSyncActionDialog->setFixedSize( 230, 120); mSyncActionDialog->show(); mSyncActionDialog->raise(); emit request_file(mResource); //emit request_file(); qApp->processEvents(); QString fileName = mFileName; QFile file( fileName ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { mErrorMessage = 0; end_connect(); error_connect("ERROR_FI\r\n\r\n"); return ; } mSyncActionDialog->setCaption( i18n("Sending file...") ); - QTextStream ts( &file ); - ts.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); - QTextStream os( mSocket ); - os.setEncoding( QTextStream::Latin1 ); + Q3TextStream os( mSocket ); + os.setEncoding( Q3TextStream::Latin1 ); while ( ! ts.atEnd() ) { os << ts.readLine() << "\r\n"; } os << "\r\n"; //os << ts.read(); file.close(); mSyncActionDialog->setCaption( i18n("Waiting for synced file...") ); mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( discardClient())); } void KServerSocket::get_file() { mSyncActionDialog->setCaption( i18n("Receiving synced file...") ); piTime.start(); piFileString = ""; @@ -1583,35 +1586,35 @@ void KServerSocket::readBackFileFromSocket() if ( piTime.elapsed () < 3000 ) { // wait for more //qDebug("waitformore "); QTimer::singleShot( 100, this , SLOT (readBackFileFromSocket( ) )); return; } QString fileName = mFileName; QFile file ( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { delete mSyncActionDialog; mSyncActionDialog = 0; qDebug("KSS:Error open read back file "); piFileString = ""; emit file_received( false, mResource); emit file_received( false); blockRC = false; return ; } // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); - QTextStream ts ( &file ); - ts.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts ( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); mSyncActionDialog->setCaption( i18n("Writing file to disk...") ); ts << piFileString; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( discardClient())); file.close(); piFileString = ""; emit file_received( true, mResource ); emit file_received( true); delete mSyncActionDialog; mSyncActionDialog = 0; blockRC = false; @@ -1643,27 +1646,27 @@ void KCommandSocket::sendFileRequest() { if ( tlw ) tlw->setCaption( i18n("Connected! Sending request for remote file ...") ); mConnectProgress.hide(); mConnectCount = 300;mConnectMax = 300; mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") ); mConnectProgress.setLabelText( i18n("Waiting for remote file...") ); mTimerSocket->start( 100, true ); - QTextStream os( mSocket ); - os.setEncoding( QTextStream::Latin1 ); + Q3TextStream os( mSocket ); + os.setEncoding( Q3TextStream::Latin1 ); QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); os << "GET " << mPassWord << curDt << " " << mRemoteResource << "\r\n\r\n"; } void KCommandSocket::readFile( QString fn ) { if ( !mSocket ) { - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); //qDebug("KCS: read file - new socket"); connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() )); } mFileString = ""; mFileName = fn; mFirst = true; @@ -1691,48 +1694,48 @@ void KCommandSocket::updateConnectDialog() mTimerSocket->start( 1000, true ); else deleteSocket(); } void KCommandSocket::writeFile( QString fileName ) { if ( !mSocket ) { - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) ); } mFileName = fileName ; mConnectCount = 30;mConnectMax = 30; mTimerSocket->start( 1000, true ); mSocket->connectToHost( mHost, mPort ); } void KCommandSocket::writeFileToSocket() { mTimerSocket->stop(); QFile file2( mFileName ); - if (!file2.open( IO_ReadOnly ) ) { + if (!file2.open( QIODevice::ReadOnly ) ) { mConnectProgress.hide(); mConnectCount = -1; mRetVal= errorW; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); return ; } mConnectProgress.setTotalSteps ( file2.size() ); mConnectProgress.show(); int count = 0; mConnectProgress.setLabelText( i18n("Sending back synced file...") ); mConnectProgress.setProgress( count ); mConnectProgress.blockSignals( true ); - QTextStream ts2( &file2 ); - ts2.setEncoding( QTextStream::Latin1 ); - QTextStream os2( mSocket ); - os2.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts2( &file2 ); + ts2.setEncoding( Q3TextStream::Latin1 ); + Q3TextStream os2( mSocket ); + os2.setEncoding( Q3TextStream::Latin1 ); os2 << "PUT " << mPassWord << " " << mRemoteResource << "\r\n\r\n";; int byteCount = 0; int byteMax = file2.size()/53; while ( ! ts2.atEnd() ) { qApp->processEvents(); if ( byteCount > byteMax ) { byteCount = 0; mConnectProgress.setProgress( count ); @@ -1743,32 +1746,32 @@ void KCommandSocket::writeFileToSocket() os2 << temp << "\r\n"; } file2.close(); mConnectProgress.hide(); mConnectCount = -1; os2 << "\r\n"; mRetVal= successW; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); mConnectProgress.blockSignals( false ); } void KCommandSocket::sendStop() { if ( !mSocket ) { - mSocket = new QSocket( this ); + mSocket = new Q3Socket( this ); connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); } mSocket->connectToHost( mHost, mPort ); - QTextStream os2( mSocket ); - os2.setEncoding( QTextStream::Latin1 ); + Q3TextStream os2( mSocket ); + os2.setEncoding( Q3TextStream::Latin1 ); os2 << "STOP\r\n\r\n"; mSocket->close(); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) QTimer::singleShot( 10, this , SLOT ( deleteSocket())); } void KCommandSocket::startReadFileFromSocket() { if ( ! mFirst ) return; mConnectProgress.setLabelText( i18n("Receiving file from remote...") ); @@ -1824,35 +1827,35 @@ void KCommandSocket::readFileFromSocket() QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) )); return; } mTimerSocket->stop(); mConnectCount = -1; mConnectProgress.hide(); QString fileName = mFileName; QFile file ( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { mFileString = ""; mRetVal = errorR; qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() ); deleteSocket(); return ; } // mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); - QTextStream ts ( &file ); - ts.setEncoding( QTextStream::Latin1 ); + Q3TextStream ts ( &file ); + ts.setEncoding( Q3TextStream::Latin1 ); ts << mFileString; file.close(); mFileString = ""; mRetVal = successR; mSocket->close(); // if state is not idle, deleteSocket(); is called via // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); - if ( mSocket->state() == QSocket::Idle ) + if ( mSocket->state() == Q3Socket::Idle ) deleteSocket(); } void KCommandSocket::deleteSocket() { //qDebug("KCommandSocket::deleteSocket() "); mConnectProgress.hide(); diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 71d17e9..32c6557 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -19,34 +19,36 @@ $Id$ */ #ifndef _KSYNCMANAGER_H #define _KSYNCMANAGER_H #include <qobject.h> #include <qstring.h> -#include <qsocket.h> +#include <q3socket.h> #include <qdatetime.h> -#include <qserversocket.h> -#include <qtextstream.h> +#include <q3serversocket.h> +#include <q3textstream.h> #include <qregexp.h> -#include <qprogressdialog.h> +#include <q3progressdialog.h> +//Added by qt3to4: +#include <Q3PopupMenu> #include <kdialog.h> -class QPopupMenu; +class Q3PopupMenu; class KSyncProfile; class KPimPrefs; class QWidget; class KSyncManager; class KSyncInterface; -class QProgressBar; +class Q3ProgressBar; -class KServerSocket : public QServerSocket +class KServerSocket : public Q3ServerSocket { Q_OBJECT public: KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); void newConnection ( int socket ) ; void setFileName( QString fn ) {mFileName = fn;}; @@ -69,17 +71,17 @@ class KServerSocket : public QServerSocket QString mResource; int mErrorMessage; bool blockRC; void send_file(); void get_file(); void end_connect(); void error_connect( QString ); QDialog* mSyncActionDialog; - QSocket* mSocket; + Q3Socket* mSocket; QString mPassWord; QString mFileName; QTime piTime; QString piFileString; }; class KCommandSocket : public QObject { @@ -103,17 +105,17 @@ class KCommandSocket : public QObject void deleteSocket(); void writeFileToSocket(); private : QString mRemoteResource; int mConnectCount; int mConnectMax; KProgressDialog mConnectProgress; QWidget* tlw; - QSocket* mSocket; + Q3Socket* mSocket; QString mPassWord; Q_UINT16 mPort; QString mHost; QString mFileName; QTimer* mTimerSocket; int mRetVal; QTime mTime; QString mFileString; @@ -127,17 +129,17 @@ class KSyncManager : public QObject Q_OBJECT public: enum TargetApp { KOPI = 0, KAPI = 1, PWMPI = 2 }; - KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); + KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, Q3PopupMenu* syncmenu); ~KSyncManager() ; void multiSync( bool askforPrefs ); bool blockSave() { return mBlockSaveFlag; } void setBlockSave(bool sa) { mBlockSaveFlag = sa; } void setDefaultFileName( QString s) ; QString defaultFileName() { return mDefFileName ;} QString syncFileName(); @@ -214,18 +216,18 @@ class KSyncManager : public QObject bool mPisyncFinished; QStringList mSpecificResources; QString mCurrentResourceLocal; QString mCurrentResourceRemote; bool mBlockSaveFlag; QWidget* mParent; KSyncInterface* mImplementation; TargetApp mTargetApp; - QPopupMenu* mSyncMenu; - QProgressBar* bar; + Q3PopupMenu* mSyncMenu; + Q3ProgressBar* bar; bool mSyncWithDesktop; private slots: void displayErrorPort(); void confSync(); }; diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 2b87298..fd5bbca 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -18,38 +18,42 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qcombobox.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> -#include <qstrlist.h> +#include <q3strlist.h> #include <qapplication.h> #include <qlayout.h> -#include <qscrollview.h> -#include <qvgroupbox.h> -#include <qhgroupbox.h> +#include <q3scrollview.h> +#include <q3vgroupbox.h> +#include <q3hgroupbox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3Frame> #include <kcolorbutton.h> #include <kdebug.h> #include <klocale.h> #include <kglobal.h> #include <kfontdialog.h> #include <kmessagebox.h> #include <kcolordialog.h> @@ -84,48 +88,48 @@ KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) : KSyncPrefsDialog::~KSyncPrefsDialog() { } void KSyncPrefsDialog::setupSyncAlgTab() { QLabel * lab; //QFrame *page = addPage(i18n("Sync Prefs"),0,0); - QVBox * mainbox = new QVBox( this ); - QScrollView* sv = new QScrollView( mainbox ); - QHBoxLayout * lay = new QHBoxLayout( this ); + Q3VBox * mainbox = new Q3VBox( this ); + Q3ScrollView* sv = new Q3ScrollView( mainbox ); + Q3HBoxLayout * lay = new Q3HBoxLayout( this ); lay->addWidget( mainbox ); - QHBox * b_box = new QHBox( mainbox ); + Q3HBox * b_box = new Q3HBox( mainbox ); QPushButton* button = new QPushButton( i18n("Ok"), b_box ); connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); button = new QPushButton( i18n("Cancel"), b_box ); connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); //QBoxLayout * sl = new QVBoxLayout(this ); //sl->addWidget ( sv ); - sv->setResizePolicy ( QScrollView::AutoOneFit ); - QFrame *topFrame = new QFrame ( sv ); + sv->setResizePolicy ( Q3ScrollView::AutoOneFit ); + Q3Frame *topFrame = new Q3Frame ( sv ); sv->addChild( topFrame ); mSetupSyncAlgTab = topFrame; - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); int iii = 0; //topLayout->addMultiCellWidget(lab , iii,iii,0,1); //++iii; mMyMachineName = new QLineEdit(topFrame); lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mMyMachineName,iii,1); ++iii; - QHBox* buttonbox = new QHBox( topFrame); + Q3HBox* buttonbox = new Q3HBox( topFrame); topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); ++iii; button = new QPushButton( i18n("New profile"), buttonbox ); connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); button = new QPushButton( i18n("Clone profile"), buttonbox ); connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); @@ -140,250 +144,250 @@ void KSyncPrefsDialog::setupSyncAlgTab() lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mProfileBox, iii,1); ++iii; - QHGroupBox *iims = new QHGroupBox( i18n("Multiple Sync options"), topFrame); + Q3HGroupBox *iims = new Q3HGroupBox( i18n("Multiple Sync options"), topFrame); new QLabel( i18n("Include in multiple "), iims ); mIncludeInRing = new QCheckBox( i18n("calendar "), iims ); mIncludeInRingAB = new QCheckBox( i18n("addressbook "), iims ); mIncludeInRingPWM = new QCheckBox( i18n("pwmanager"), iims ); new QLabel( i18n(" sync"), iims ); topLayout->addMultiCellWidget(iims, iii,iii,0,1); ++iii; - QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame); + Q3VGroupBox* gb0 = new Q3VGroupBox( i18n("Sync algo options"), topFrame); topLayout->addMultiCellWidget(gb0, iii,iii,0,1); ++iii; - QButtonGroup* gr; + Q3ButtonGroup* gr; { - QVGroupBox* topFrame = gb0; + Q3VGroupBox* topFrame = gb0; mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); //++iii; - gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); + gr = new Q3ButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); //topLayout->addMultiCellWidget(gr, iii,iii,0,1); //++iii; loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); // both = new QRadioButton ( i18n("Take both on conflict"), gr ); mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); //++iii; #if 0 - QHGroupBox* gb51 = new QHGroupBox( i18n("Local resources to sync with:"), topFrame); + Q3HGroupBox* gb51 = new Q3HGroupBox( i18n("Local resources to sync with:"), topFrame); { - QVBox * fibo2 = new QVBox ( gb51 ); + Q3VBox * fibo2 = new Q3VBox ( gb51 ); new QLabel ( i18n("Calendar resources:"), fibo2 ); //mFilterInCal = new QComboBox( fibo2 ); - fibo2 = new QVBox ( gb51 ); + fibo2 = new Q3VBox ( gb51 ); new QLabel ( i18n("Addressbook resources:"), fibo2 ); //mFilterInAB = new QComboBox( fibo2 ); } #endif - QHGroupBox* gb5 = new QHGroupBox( i18n("Apply filter when adding data to local:"), topFrame); - QVBox * fibo2 = new QVBox ( gb5 ); + Q3HGroupBox* gb5 = new Q3HGroupBox( i18n("Apply filter when adding data to local:"), topFrame); + Q3VBox * fibo2 = new Q3VBox ( gb5 ); new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); mFilterInCal = new QComboBox( fibo2 ); - fibo2 = new QVBox ( gb5 ); + fibo2 = new Q3VBox ( gb5 ); new QLabel ( i18n("Incoming addressbook filter:"), fibo2 ); mFilterInAB = new QComboBox( fibo2 ); mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); // ++iii; - QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); + Q3VGroupBox* gb2 = new Q3VGroupBox( i18n("Write back options"), topFrame); //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); //++iii; { - QVGroupBox*topFrame = gb2; + Q3VGroupBox*topFrame = gb2; mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame ); - QHGroupBox* gb4 = new QHGroupBox( i18n("Apply filter when adding data to remote:"), topFrame); - QVBox * fibo = new QVBox ( gb4 ); + Q3HGroupBox* gb4 = new Q3HGroupBox( i18n("Apply filter when adding data to remote:"), topFrame); + Q3VBox * fibo = new Q3VBox ( gb4 ); new QLabel ( i18n("Outgoing calendar filter:"), fibo ); mFilterOutCal = new QComboBox( fibo ); - fibo = new QVBox ( gb4 ); + fibo = new Q3VBox ( gb4 ); new QLabel ( i18n("Outgoing addressbook filter:"), fibo ); mFilterOutAB = new QComboBox( fibo ); //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); //++iii; mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); //++iii; - QVGroupBox* gb3 = new QVGroupBox( i18n("Time period"), topFrame); + Q3VGroupBox* gb3 = new Q3VGroupBox( i18n("Time period"), topFrame); connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); new QLabel( i18n("From ") , gb3 ); - QHBox * tf1 = new QHBox ( gb3 ); + Q3HBox * tf1 = new Q3HBox ( gb3 ); mWriteBackPastWeeks= new QSpinBox(1,104, 1, tf1 ); mWriteBackPastWeeks->setMaximumWidth( 100 ); new QLabel( i18n(" weeks in the past to ") ,tf1 ); - QHBox * tf2 = new QHBox ( gb3 ); + Q3HBox * tf2 = new Q3HBox ( gb3 ); mWriteBackFutureWeeks= new QSpinBox(1,104, 1, tf2); mWriteBackFutureWeeks->setMaximumWidth( 100 ); new QLabel( i18n(" weeks in the future ") , tf2 ); //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); //++iii; gb3->setEnabled( false ); connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); } connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); } - proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); + proGr = new Q3ButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); gr = proGr; topLayout->addMultiCellWidget(gr, iii,iii,0,1); ++iii; mIsLocal = new QRadioButton ( i18n("Local file"), gr ); mIsPi = new QRadioButton ( i18n("Pi-Sync - all calendars ( direct Kx/Pi to Kx/Pi sync )"), gr ); connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected calendars ( direct Kx/Pi to Kx/Pi sync )"), gr ); connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); - QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); + Q3VGroupBox* gb1 = new Q3VGroupBox( i18n("Profile kind specific settings"), topFrame); topLayout->addMultiCellWidget(gb1, iii,iii,0,1); ++iii; // ****************************************** // Profile kind specific settings { // *** phone ******************************* - QVGroupBox* topFrame = gb1; - phoneWidget = new QVBox( topFrame); + Q3VGroupBox* topFrame = gb1; + phoneWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); //++iii; mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); - QHBox* temphb = new QHBox( phoneWidget ); + Q3HBox* temphb = new Q3HBox( phoneWidget ); new QLabel( i18n("I/O device: "), temphb ); mPhoneDevice = new QLineEdit( temphb); button = new QPushButton( i18n("Help..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); - temphb = new QHBox( phoneWidget ); + temphb = new Q3HBox( phoneWidget ); new QLabel( i18n("Connection: "), temphb ); mPhoneConnection = new QLineEdit( temphb); button = new QPushButton( i18n("Help..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); - temphb = new QHBox( phoneWidget ); + temphb = new Q3HBox( phoneWidget ); new QLabel( i18n("Model(opt.): "), temphb ); mPhoneModel = new QLineEdit( temphb); button = new QPushButton( i18n("Help..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); // *** local******************************* - localFileWidget = new QVBox( topFrame); + localFileWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); //++iii; - temphb = new QHBox( localFileWidget ); + temphb = new Q3HBox( localFileWidget ); lab = new QLabel( i18n("Local file Cal:"), temphb ); lab = new QLabel( i18n("Local file ABook:"), temphb ); lab = new QLabel( i18n("Local file PWMgr:"), temphb ); - temphb = new QHBox( localFileWidget ); + temphb = new Q3HBox( localFileWidget ); button = new QPushButton( i18n("Choose..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); button = new QPushButton( i18n("Choose..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); button = new QPushButton( i18n("Choose..."), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); - temphb = new QHBox( localFileWidget ); + temphb = new Q3HBox( localFileWidget ); mRemoteFile = new QLineEdit( temphb); mRemoteFileAB = new QLineEdit( temphb); mRemoteFilePWM = new QLineEdit( temphb); mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); // *** remote******************************* - remoteFileWidget = new QVBox( topFrame); + remoteFileWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); //++iii; - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); new QLabel( i18n("Calendar:"), temphb); new QLabel( i18n("AddressBook:"), temphb); new QLabel( i18n("PWManager:"), temphb); lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); mRemotePrecommand = new QLineEdit(temphb); mRemotePrecommandAB = new QLineEdit(temphb); mRemotePrecommandPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); mLocalTempFile = new QLineEdit(temphb); mLocalTempFileAB = new QLineEdit(temphb); mLocalTempFilePWM = new QLineEdit(temphb); lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); mRemotePostcommand = new QLineEdit(temphb ); mRemotePostcommandAB = new QLineEdit(temphb ); mRemotePostcommandPWM = new QLineEdit(temphb ); mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); - temphb = new QHBox( remoteFileWidget ); + temphb = new Q3HBox( remoteFileWidget ); button = new QPushButton( i18n("ssh/scp"), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); button = new QPushButton( i18n("ftp"), temphb ); connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); // *** pi-sync******************************* - piWidget = new QVBox( topFrame); + piWidget = new Q3VBox( topFrame); //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); //++iii; - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); new QLabel( i18n("Calendar:"), temphb); new QLabel( i18n("AddressBook:"), temphb); new QLabel( i18n("PWManager:"), temphb); lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); mRemotePw = new QLineEdit(temphb); mRemotePwAB = new QLineEdit(temphb); mRemotePwPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); mRemoteIP = new QLineEdit(temphb); mRemoteIPAB = new QLineEdit(temphb); mRemoteIPPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); - temphb = new QHBox( piWidget ); + temphb = new Q3HBox( piWidget ); mRemotePort = new QLineEdit(temphb); mRemotePortAB = new QLineEdit(temphb); mRemotePortPWM = new QLineEdit(temphb); lab = new QLabel( i18n("Local/remote Resource sync partners (Leave empty to not sync)"), piWidget); - mTableBox = new QHBox( piWidget ); - mResTableKopi = new QTable( 1, 1, mTableBox ); - mResTableKapi = new QTable( 1, 1, mTableBox ); - mResTablePwmpi = new QTable( 1, 1, mTableBox ); + mTableBox = new Q3HBox( piWidget ); + mResTableKopi = new Q3Table( 1, 1, mTableBox ); + mResTableKapi = new Q3Table( 1, 1, mTableBox ); + mResTablePwmpi = new Q3Table( 1, 1, mTableBox ); mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); mResTableKopi->setLeftMargin( 80 ); mResTableKapi->setLeftMargin( 80 ); } // ****************************************** // Profile kind specific settings END @@ -463,17 +467,17 @@ void KSyncPrefsDialog::readFilter() void KSyncPrefsDialog::slotOK() { if ( mMyMachineName->text() == "undefined" ) { KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); return; } int i; for (i = 0; i < mSyncProfileNames.count(); ++ i) { - if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { + if ( mSyncProfileNames.count( mSyncProfileNames[i]) > 1 ) { KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); return; } } usrWriteConfig(); QDialog::accept(); } void KSyncPrefsDialog::accept() diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index d8c02de..1d7503e 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h @@ -20,32 +20,32 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef _KSYNCPREFSDIALOG_H #define _KSYNCPREFSDIALOG_H #include <kdialogbase.h> -#include <qptrlist.h> -#include <qtable.h> -#include <qhbox.h> +#include <q3ptrlist.h> +#include <q3table.h> +#include <q3hbox.h> //#include <libkdepim/kprefsdialog.h> class KColorButton; class QSpinBox;; class QRadioButton; class QCheckBox; class QSlider; class KURLRequester; class QComboBox; -class QButtonGroup; +class Q3ButtonGroup; class QLineEdit; -class QVBox; +class Q3VBox; class QStringList; class KSyncProfile; /** Dialog to change the korganizer configuration. */ class KSyncPrefsDialog : public KDialog { Q_OBJECT @@ -81,17 +81,17 @@ class KSyncPrefsDialog : public KDialog protected: void usrWriteConfig(); void setupSyncAlgTab(); void readFilter(); void readResources(); private: void updateMyCaption(); int currentSelection; - QPtrList<KSyncProfile> mSyncProfiles; + Q3PtrList<KSyncProfile> mSyncProfiles; QStringList mSyncProfileNames; QStringList mFilterKapi; QStringList mFilterKopi; QStringList mResourcesKopi; QStringList mResourcesKapi; QLineEdit * mMyMachineName; QComboBox * mProfileBox; QRadioButton* mIsLocal; @@ -100,21 +100,21 @@ class KSyncPrefsDialog : public KDialog QRadioButton* mIsPi; QRadioButton* mIsPiSpecific; QCheckBox* mIncludeInRing; QCheckBox* mIncludeInRingAB; QCheckBox* mIncludeInRingPWM; void addProfile ( KSyncProfile* ); void insertProfiles(); void saveProfile(); - QButtonGroup* proGr; - QHBox * mTableBox; - QTable* mResTableKopi; - QTable* mResTableKapi; - QTable* mResTablePwmpi; + Q3ButtonGroup* proGr; + Q3HBox * mTableBox; + Q3Table* mResTableKopi; + Q3Table* mResTableKapi; + Q3Table* mResTablePwmpi; QComboBox * mFilterOutCal; QComboBox * mFilterInCal; QComboBox * mFilterOutAB; QComboBox * mFilterInAB; QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; @@ -147,20 +147,20 @@ class KSyncPrefsDialog : public KDialog QLineEdit * mRemoteIPPWM; QLineEdit * mRemotePortPWM; QLineEdit * mPhoneDevice; QLineEdit * mPhoneConnection; QLineEdit * mPhoneModel; QWidget* mSetupSyncAlgTab; - QVBox* localFileWidget; - QVBox* remoteFileWidget; - QVBox* phoneWidget; - QVBox* piWidget; + Q3VBox* localFileWidget; + Q3VBox* remoteFileWidget; + Q3VBox* phoneWidget; + Q3VBox* piWidget; QCheckBox* mWriteBackFile; QCheckBox* mWriteBackFuture; QSpinBox* mWriteBackFutureWeeks; QSpinBox* mWriteBackPastWeeks; QCheckBox* mWriteBackExisting; QCheckBox* mAskForPreferences; QCheckBox* mShowSummaryAfterSync; QCheckBox* mWriteContactToSIM; diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 91fcfc5..1e41662 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h @@ -15,17 +15,17 @@ You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _KSYNCPROFILE_H #define _KSYNCPROFILE_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qcolor.h> #include <qfont.h> #include <qstringlist.h> #include <qobject.h> #include <qstring.h> #include <libkcal/syncdefines.h> diff --git a/libkdepim/libkdepim.pro b/libkdepim/libkdepim.pro index 7160d0e..fb27311 100644 --- a/libkdepim/libkdepim.pro +++ b/libkdepim/libkdepim.pro @@ -1,12 +1,12 @@ TEMPLATE = lib CONFIG = qt warn_on DEFINES +=KORG_NOKABC -TARGET = microkdepim +TARGET = xmicrokdepim INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. DESTDIR=../bin DEFINES += DESKTOP_VERSION include( ../variables.pri ) unix : { OBJECTS_DIR = obj/unix MOC_DIR = moc/unix @@ -69,8 +69,10 @@ release: { LIBS += mfc71u.lib } DEFINES += _OL_IMPORT_ HEADERS += ol_access.h SOURCES += ol_access.cpp #olimport section end } } +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro index f3db68e..4b42184 100644 --- a/libkdepim/libkdepimE.pro +++ b/libkdepim/libkdepimE.pro @@ -1,14 +1,14 @@ TEMPLATE = lib CONFIG += qt warn_on -TARGET = microkdepim +TARGET = xmicrokdepim INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include -LIBS += -lmicrokde -#LIBS += -lmicrokcal +LIBS += -lxmicrokde +#LIBS += -lxmicrokcal LIBS += -L$(QPEDIR)/lib OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR=$(QPEDIR)/lib INTERFACES = \ diff --git a/libkdepim/ol_access.cpp b/libkdepim/ol_access.cpp index 1b05693..821f148 100755 --- a/libkdepim/ol_access.cpp +++ b/libkdepim/ol_access.cpp @@ -17,31 +17,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qtooltip.h> -#include <qframe.h> +#include <q3frame.h> #include <qpixmap.h> #include <qlayout.h> -#include <qprogressbar.h> -#include <qprogressdialog.h> -#include <qwidgetstack.h> +#include <q3progressbar.h> +#include <q3progressdialog.h> +#include <q3widgetstack.h> #include <qdatetime.h> #include <qdir.h> #include <qpushbutton.h> #include <qregexp.h> #include <qapplication.h> -#include <qhbox.h> -#include <qheader.h> +#include <q3hbox.h> +#include <q3header.h> #include <qdatetime.h> -#include <qlistview.h> +#include <q3listview.h> #include <kdebug.h> #include <klocale.h> #include <kstandarddirs.h> #include <kmessagebox.h> #include <kfiledialog.h> #include <kstaticdeleter.h> #include <kdialogbase.h> @@ -49,23 +49,23 @@ #include <ol_access.h> #include "../outport/msoutl9.h" #include <ole2.h> #include <comutil.h> -class OLEListViewItem : public QCheckListItem +class OLEListViewItem : public Q3CheckListItem { public: - OLEListViewItem( QListView *parent, QString text ) : - QCheckListItem( parent, text, QCheckListItem::CheckBox ) { ; }; - OLEListViewItem( QListViewItem *after, QString text ) : - QCheckListItem( after, text, QCheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListView *parent, QString text ) : + Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListViewItem *after, QString text ) : + Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { ; }; ~OLEListViewItem() {}; void setData( DWORD data ) {mData= data; }; void setDataID( QString data ){ mDataID = data ;} QString dataID() { return mDataID;} DWORD data() { return mData ;}; private: DWORD mData; QString mDataID; @@ -73,25 +73,25 @@ private: class OLEFolderSelect : public KDialogBase { public: OLEFolderSelect() : KDialogBase( Plain, "", Ok | Cancel, Ok, 0, "", true, false, i18n("Import!") ) { - QHBox * mw = new QHBox( this ); + Q3HBox * mw = new Q3HBox( this ); setMainWidget( mw ); - mListView = new QListView( mw ); + mListView = new Q3ListView( mw ); mListView->addColumn(i18n("Select Folder")); mListView->addColumn(i18n("Content Type")); } - QListView* listView() { return mListView;} + Q3ListView* listView() { return mListView;} private: - QListView* mListView; + Q3ListView* mListView; }; OL_access *OL_access::sInstance = 0; static KStaticDeleter<OL_access> staticDeleterPim; OL_access *OL_access::instance() { if ( !sInstance ) { @@ -144,17 +144,17 @@ void OL_access::readContactData( LPDISPATCH dispItem, KABC::Addressee::List* li _variant_t indx((long)0); LPDISPATCH itm; int i; folderItems = mf.GetItems(); QString cap = i18n("Importing contact data"); if ( syncMode ) { cap = i18n("Reading contact data..."); } - QProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(), 0 ); + Q3ProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(), 0 ); bar.setCaption (i18n("Accessing OL") ); int h = bar.sizeHint().height() ; int w = 300; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); bar.show(); for(i=1; i <= folderItems.GetCount(); ++i) @@ -168,17 +168,17 @@ void OL_access::readContactData( LPDISPATCH dispItem, KABC::Addressee::List* li _ContactItem * pItem = (_ContactItem *)&itm; list->append( ol2kapiContact( pItem, syncMode ) ); itm->Release(); } } QStringList OL_access::getFolderSelection( int type , QString caption ) { OLEFolderSelect folder_dialog; - QListView * listView = folder_dialog.listView(); + Q3ListView * listView = folder_dialog.listView(); MAPIFolder mfInbox; MAPIFolder mfRoot; CString szName; _NameSpace olNS; olNS = gOlAppAB.GetNamespace(_T("MAPI")); mfInbox = olNS.GetDefaultFolder(6); mfRoot = mfInbox.GetParent(); szName = mfRoot.GetName(); @@ -1130,23 +1130,23 @@ DATE Qdt2date( QDateTime dt ) DATE ddd; COleDateTime odt; odt.SetDateTime(dt.date().year(), dt.date().month(),dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); ddd = odt; return ddd; } -class OLEListViewItem : public QCheckListItem +class OLEListViewItem : public Q3CheckListItem { public: - OLEListViewItem( QListView *parent, QString text ) : - QCheckListItem( parent, text, QCheckListItem::CheckBox ) { ; }; - OLEListViewItem( QListViewItem *after, QString text ) : - QCheckListItem( after, text, QCheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListView *parent, QString text ) : + Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { ; }; + OLEListViewItem( Q3ListViewItem *after, QString text ) : + Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { ; }; ~OLEListViewItem() {}; void setData( DWORD data ) {mData= data; }; void setDataID( QString data ){ mDataID = data ;} QString dataID() { return mDataID;} DWORD data() { return mData ;}; private: DWORD mData; QString mDataID; @@ -1154,19 +1154,19 @@ class OLEListViewItem : public QCheckListItem bool KAImportOLdialog::sOLDispatch = false; KAImportOLdialog::KAImportOLdialog( const QString &caption, KABC::AddressBook * aBook, QWidget *parent ) : KDialogBase( Plain, caption, User1 | Close, Ok, parent, caption, true, false, i18n("Import!") ) { mSyncMode = false; - QHBox * mw = new QHBox( this ); + Q3HBox * mw = new Q3HBox( this ); setMainWidget( mw ); - mListView = new QListView( mw ); + mListView = new Q3ListView( mw ); mListView->addColumn(i18n("Select Folder")); mListView->addColumn(i18n("Content Type")); mABook = aBook; connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply())); setupFolderView(); resize( sizeHint().width()+50, sizeHint().height()+50 ); } @@ -1298,17 +1298,17 @@ void KAImportOLdialog::readContactData( DWORD folder ) _variant_t indx((long)0); LPDISPATCH itm; int i; folderItems = mf.GetItems(); QString cap = i18n("Importing contact data"); if ( mSyncMode ) { cap = i18n("Reading contact data..."); } - QProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(),this); + Q3ProgressDialog bar( cap,i18n("Abort"), folderItems.GetCount(),this); bar.setCaption (i18n("Accessing OL") ); int h = bar.sizeHint().height() ; int w = 300; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); bar.show(); for(i=1; i <= folderItems.GetCount(); ++i) diff --git a/libkdepim/ol_access.h b/libkdepim/ol_access.h index 85dbc6c..3422f65 100755 --- a/libkdepim/ol_access.h +++ b/libkdepim/ol_access.h @@ -32,17 +32,17 @@ #include <afxdisp.h> #include "../outport/msoutl9.h" #define OL_CONTACT_DATA 2 #define OL_CALENDAR_DATA 1 //pending is this the right number class QDateTime; -class QListView; +class Q3ListView; class OLEListViewItem; class _ContactItem; class OL_access : public QObject { Q_OBJECT public: static OL_access *instance(); ~OL_access(); @@ -127,17 +127,17 @@ class KAImportOLdialog : public KDialogBase void slotCancel(); protected: void setupFolderView(); void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent); void readContactData( DWORD folder ); KABC::AddressBook * mABook; - QListView * mListView; + Q3ListView * mListView; KABC::Addressee::List mAList; bool addAddressee( KABC::Addressee a ); private: int importedItems; bool mSyncMode; QString mSelectedFolderID; }; class KAwritebackOL : public QObject diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp index 89db22b..0ea73f5 100644 --- a/libkdepim/phoneaccess.cpp +++ b/libkdepim/phoneaccess.cpp @@ -17,21 +17,22 @@ along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qstring.h> #include <qapplication.h> -#include <qptrlist.h> +#include <QDesktopWidget> +#include <q3ptrlist.h> #include <qregexp.h> #include <qfile.h> #include <qlabel.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qdir.h> #include <kmessagebox.h> #include <stdlib.h> #include "phoneaccess.h" void PhoneAccess::writeConfig( QString device, QString connection, QString model ) { @@ -41,22 +42,24 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model QString fileName = QDir::homeDirPath() +"/.gammurc"; #endif //qDebug("save %d ", load ); QString content = "[gammu]\n";; bool write = false; bool addPort = true, addConnection = true, addModel = true; QFile file( fileName ); if ( QFile::exists( fileName) ) { - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { qDebug("Error: cannot open %s ", fileName.latin1() ); return; } QString line; - while ( file.readLine( line, 1024 ) > 0 ) { + char tmp[1024]; + while ( file.readLine( tmp, 1024 ) > 0 ) { + line = tmp; //qDebug("*%s* ", line.latin1() ); if ( line.left(7 ) == "[gammu]" ) { ; } else if ( line.left(4 ) == "port" ) { if ( line == "port = " + device+"\n" ) { content += line ; addPort = false; @@ -110,22 +113,22 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model } if ( addModel ) { write = true; content += "model = "; content += model; content += "\n"; } if ( write ) { - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { qDebug("Error: cannot write file %s ", fileName.latin1() ); return; } qDebug("Writing file %s ", fileName.latin1() ); - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts << content ; file.close(); } } bool PhoneAccess::writeToPhone( QString fileName) |