misc compile
authordmacvicar <dmacvicar@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Sun, 9 Dec 2007 21:06:23 +0000 (21:06 +0000)
committerdmacvicar <dmacvicar@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Sun, 9 Dec 2007 21:06:23 +0000 (21:06 +0000)
git-svn-id: http://svn.opensuse.org/svn/yast/trunk/qt4@42883 e0cc52ee-31ee-0310-8b87-e83c4596d67c

15 files changed:
src/QY2ComboTabWidget.cc
src/QY2ComboTabWidget.h
src/pkg/YQPackageSelectorBase.cc
src/pkg/YQPatternSelector.cc
src/pkg/YQPatternSelector.h
src/pkg/YQPkgDiskUsageList.cc
src/pkg/YQPkgDiskUsageList.h
src/pkg/YQPkgPatchList.h
src/pkg/YQPkgPatternList.h
src/pkg/YQPkgStatusFilterView.cc
src/pkg/YQPkgStatusFilterView.h
src/pkg/YQPkgUpdateProblemFilterView.cc
src/pkg/YQPkgUpdateProblemFilterView.h
src/pkg/YQSimplePatchSelector.cc
src/pkg/YQSimplePatchSelector.h

index 5afdeb7..1d023c8 100644 (file)
@@ -96,7 +96,7 @@ QY2ComboTabWidget::addPage( const QString & page_label, QWidget * new_page )
 
 
 void
-QY2ComboTabWidget::showPage( int index )
+QY2ComboTabWidget::showPageIndex( int index )
 {
     QWidget * page = pages[ index ];
 
index 030e9c1..d981ed8 100644 (file)
@@ -87,7 +87,7 @@ protected slots:
      * Show a page identified by its index. Does NOT update the combo box
      * contents.
      **/
-    void showPage( int index );
+    void showPageIndex( int index );
 
 
 protected:
index cf24e7b..3cf86fb 100644 (file)
@@ -19,7 +19,7 @@
 /-*/
 
 #include <QMessageBox>
-#include <QEvent>
+#include <QKeyEvent>
 
 #define y2log_component "qt-pkg"
 #include <ycp/y2log.h>
index 0d98c48..7c0f1cc 100644 (file)
@@ -246,14 +246,17 @@ YQPatternSelector::layoutRightPane( QWidget * parent )
 void
 YQPatternSelector::layoutButtons( QWidget * parent )
 {
-    Q3HBox * button_box = new Q3HBox( parent );
+    QWidget *button_box = new QWidget(parent);
+    QHBoxLayout *layout = new QHBoxLayout(button_box);
+
     Q_CHECK_PTR( button_box );
-    button_box->setMargin ( MARGIN  );
-    button_box->setSpacing( SPACING );
+    layout->setMargin ( MARGIN  );
+    layout->setSpacing( SPACING );
 
-    parent->layout()->addWidget( button_box );
+   button_box->setLayout(layout);
 
     QPushButton * details_button = new QPushButton( _( "&Details..." ), button_box );
+    layout->addWidget(details_button);
     Q_CHECK_PTR( details_button );
     details_button->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert
 
@@ -261,10 +264,11 @@ YQPatternSelector::layoutButtons( QWidget * parent )
             this,              SLOT  ( detailedPackageSelection() ) );
 
 
-    addHStretch( button_box );
+    layout->addStretch();
 
     QPushButton * cancel_button = new QPushButton( _( "&Cancel" ), button_box );
     Q_CHECK_PTR( cancel_button );
+    layout->addWidget(cancel_button);
     cancel_button->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert
 
     connect( cancel_button, SIGNAL( clicked() ),
@@ -273,6 +277,7 @@ YQPatternSelector::layoutButtons( QWidget * parent )
 
     QPushButton * accept_button = new QPushButton( _( "&Accept" ), button_box );
     Q_CHECK_PTR( accept_button );
+    layout->addWidget(accept_button);
     accept_button->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert
 
     connect( accept_button, SIGNAL( clicked() ),
index ff7c0f4..0550469 100644 (file)
@@ -20,8 +20,7 @@
 #ifndef YQPatternSelector_h
 #define YQPatternSelector_h
 
-#include <q3vbox.h>
-#include <qcolor.h>
+#include <QColor>
 #include <ycp/YCPString.h>
 
 #include "YQPackageSelectorBase.h"
index a997332..fc1382e 100644 (file)
@@ -83,7 +83,7 @@ YQPkgDiskUsageList::YQPkgDiskUsageList( QWidget * parent, int thresholdPercent )
            YQPkgDiskUsageListItem * item = new YQPkgDiskUsageListItem( this, partitionDu );
            Q_CHECK_PTR( item );
            item->updateData();
-           _items.insert( partitionDu.dir.c_str(), item );
+           _items.insert( QByteArray(partitionDu.dir.c_str()), item );
        }
     }
 
index 92adcdf..645f8ce 100644 (file)
@@ -22,9 +22,9 @@
 
 #include <zypp/DiskUsageCounter.h>
 #include <QY2DiskUsageList.h>
-#include <q3asciidict.h>
-//Added by qt3to4:
-#include <qevent.h>
+#include <QKeyEvent>
+#include <QHash>
+#include <QByteArray>
 
 typedef zypp::DiskUsageCounter::MountPoint ZyppPartitionDu;
 class YQPkgDiskUsageListItem;
@@ -189,7 +189,7 @@ protected:
 
     // Data members
 
-    Q3AsciiDict<YQPkgDiskUsageListItem>  _items;
+    QHash<QByteArray, YQPkgDiskUsageListItem*>  _items;
     bool                               _debug;
 };
 
index ef698ed..68bbfdc 100644 (file)
@@ -23,7 +23,6 @@
 #include <string>
 #include "YQPkgObjList.h"
 #include "YQPkgSelMapper.h"
-//Added by qt3to4:
 #include <QTreeWidgetItem>
 #include <QEvent>
 #include <QMenu>
index 021fce3..d6161b5 100644 (file)
@@ -21,7 +21,7 @@
 #define YQPkgPatternList_h
 
 #include "YQPkgObjList.h"
-#include <q3dict.h>
+#include <QMap>
 
 
 class YQPkgPatternListItem;
@@ -152,7 +152,7 @@ protected:
     // Data members
     //
 
-    Q3Dict<YQPkgPatternCategoryItem> _categories;
+    QMap<QString, YQPkgPatternCategoryItem*> _categories;
 };
 
 
index 51affe8..e48445c 100644 (file)
 
 /-*/
 
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <q3groupbox.h>
-//Added by qt3to4:
-#include <qpixmap.h>
+#include <QCheckBox>
+#include <QLabel>
+#include <QLayout>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QPixmap>
 
 #define y2log_component "qt-pkg"
 #include <ycp/y2log.h>
 
 
 YQPkgStatusFilterView::YQPkgStatusFilterView( QWidget * parent )
-    : Q3VBox( parent )
+    : QWidget( parent )
 {
-    setMargin( MARGIN );
-    setSpacing( SPACING );
+    QVBoxLayout *layout = new QVBoxLayout(this);
+    setLayout(layout);
+    layout->setMargin( MARGIN );
+    layout->setSpacing( SPACING );
 
-    addVStretch( this );
+    layout->addStretch();
 
 #if 0
     // Headline
@@ -61,8 +63,10 @@ YQPkgStatusFilterView::YQPkgStatusFilterView( QWidget * parent )
     // Packages with what status to show
     //
 
-    Q3GroupBox * gbox = new Q3GroupBox( 3, Qt::Horizontal, _( "Show packages with status" ), this );
+    QGroupBox * gbox = new QGroupBox( _( "Show packages with status" ), this );
     Q_CHECK_PTR( gbox );
+    QHBoxLayout *hlayout = new QHBoxLayout;
+    gbox->setLayout(hlayout);
 
     _showDel           = addStatusCheckBox( gbox, _( "Delete" ),       YQIconPool::disabledPkgDel(),           true );
     _showInstall       = addStatusCheckBox( gbox, _( "Install" ),      YQIconPool::disabledPkgInstall(),       true );
@@ -73,32 +77,43 @@ YQPkgStatusFilterView::YQPkgStatusFilterView( QWidget * parent )
     _showTaboo         = addStatusCheckBox( gbox, _( "Taboo" ),        YQIconPool::disabledPkgTaboo(),         true );
     _showProtected     = addStatusCheckBox( gbox, _( "Protected" ),    YQIconPool::disabledPkgProtected(),     true );
 
-    addVSpacing( gbox, 8 );
-    addHStretch( gbox ); // For the other columns of the QGroupBox ( prevent wraparound )
-    addHStretch( gbox );
+    hlayout->addWidget(_showDel);
+    hlayout->addWidget(_showInstall);
+    hlayout->addWidget(_showUpdate);
+    hlayout->addWidget(_showAutoDel);
+    hlayout->addWidget(_showAutoInstall);
+    hlayout->addWidget(_showAutoUpdate);
+    hlayout->addWidget(_showTaboo);
+    hlayout->addWidget(_showProtected);
+
+    hlayout->addSpacing( 8 );
+    hlayout->addStretch(); // For the other columns of the QGroupBox ( prevent wraparound )
+    hlayout->addStretch();
 
     _showKeepInstalled = addStatusCheckBox( gbox, _( "Keep" ),           YQIconPool::disabledPkgKeepInstalled(), false );
     _showNoInst                = addStatusCheckBox( gbox, _( "Do not install" ), YQIconPool::disabledPkgNoInst(),        false );
 
-    addVStretch( this );
+    layout->addStretch();
 
 
     // Box for refresh button
-    Q3HBox * hbox = new Q3HBox( this );
-    Q_CHECK_PTR( hbox );
+    hlayout = new QHBoxLayout();
+    layout->addLayout(hlayout);
 
-    addHStretch( hbox );
+    hlayout->addStretch();
 
     // Refresh button
-    _refreshButton = new QPushButton( _( "&Refresh List" ), hbox );
+    _refreshButton = new QPushButton( _( "&Refresh List" ), this );
     Q_CHECK_PTR( _refreshButton );
-    addHStretch( hbox );
+    hlayout->addWidget(_refreshButton);
+
+    hlayout->addStretch();
 
     connect( _refreshButton,   SIGNAL( clicked() ),
             this,              SLOT  ( filter()  ) );
 
     for ( int i=0; i < 6; i++ )
-       addVStretch( this );
+       layout->addStretch();
 }
 
 
index c7d4413..1b3fb58 100644 (file)
 #define YQPkgStatusFilterView_h
 
 #include "YQZypp.h"
-#include <q3vbox.h>
-#include <qregexp.h>
-//Added by qt3to4:
-#include <qpixmap.h>
+#include <QWidget>
+#include <QRegExp>
+#include <QPixmap>
 
 
 class QComboBox;
@@ -35,7 +34,7 @@ class QPushButton;
 /**
  * @short Filter view for packages that made problems during update
  **/
-class YQPkgStatusFilterView : public Q3VBox
+class YQPkgStatusFilterView : public QWidget
 {
     Q_OBJECT
 
index bb161e2..322e1fd 100644 (file)
@@ -33,7 +33,7 @@ using std::list;
 
 
 YQPkgUpdateProblemFilterView::YQPkgUpdateProblemFilterView( QWidget * parent )
-    : Q3TextBrowser( parent )
+    : QTextBrowser( parent )
 {
     QString html = _( "\
 <br>\n\
@@ -56,8 +56,7 @@ The safest course of action is to delete them.\n\
 </p>\
 " );
 
-    setTextFormat( Qt::RichText );
-    setText( html );
+    setHtml( html );
 }
 
 
index 5053897..b0236e6 100644 (file)
 
 
 #include "YQZypp.h"
-#include <q3textbrowser.h>
+#include <QTextBrowser>
 #include "YQPkgSelMapper.h"
 
 
 /**
  * @short Filter view for packages that made problems during update
  **/
-class YQPkgUpdateProblemFilterView : public Q3TextBrowser
+class YQPkgUpdateProblemFilterView : public QTextBrowser
 {
     Q_OBJECT
 
index d13ff63..547571d 100644 (file)
@@ -174,24 +174,28 @@ YQSimplePatchSelector::basicLayout()
 void
 YQSimplePatchSelector::layoutButtons( QWidget * parent )
 {
-    Q3HBox * button_box = new Q3HBox( parent );
+    QWidget * button_box = new QWidget( parent );
+    QHBoxLayout *layout = new QHBoxLayout;
     Q_CHECK_PTR( button_box );
-    button_box->setMargin ( MARGIN  );
-    button_box->setSpacing( SPACING );
+    button_box->setLayout(layout);
+    layout->setMargin ( MARGIN  );
+    layout->setSpacing( SPACING );
 
 
     QPushButton * details_button = new QPushButton( _( "&Details..." ), button_box );
     Q_CHECK_PTR( details_button );
+    layout->addWidget(details_button);
     details_button->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert
 
     connect( details_button,   SIGNAL( clicked() ),
             this,              SLOT  ( detailedPackageSelection() ) );
 
 
-    addHStretch( button_box );
+    layout->addStretch();
 
     QPushButton * cancel_button = new QPushButton( _( "&Cancel" ), button_box );
     Q_CHECK_PTR( cancel_button );
+    layout->addWidget(cancel_button);
     cancel_button->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert
 
     connect( cancel_button, SIGNAL( clicked() ),
@@ -200,6 +204,7 @@ YQSimplePatchSelector::layoutButtons( QWidget * parent )
 
     QPushButton * accept_button = new QPushButton( _( "&Accept" ), button_box );
     Q_CHECK_PTR( accept_button );
+    layout->addWidget(accept_button);
     accept_button->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert
 
     connect( accept_button, SIGNAL( clicked() ),
index 2f35301..fed8817 100644 (file)
@@ -20,8 +20,7 @@
 #ifndef YQSimplePatchSelector_h
 #define YQSimplePatchSelector_h
 
-#include <q3vbox.h>
-#include <qcolor.h>
+#include <QColor>
 #include <ycp/YCPString.h>
 
 #include "YQPackageSelectorBase.h"