[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdevelop/parts/quickopen
From:       Amilcar do Carmo Lucas <amilcar () ida ! ing ! tu-bs ! de>
Date:       2003-10-09 8:50:04
[Download RAW message or body]

CVS commit by aclu: 

Fix compilation on QT 3.0.4

Thanks to Iztok Kobal for the patch.


  M +26 -0     quickopenclassdialog.cpp   1.2


--- kdevelop/parts/quickopen/quickopenclassdialog.cpp  #1.1:1.2
@@ -34,4 +34,26 @@
 #include <qlabel.h>
 
+#if QT_VERSION < 0x030100
+/* original source from qt-3.2.1/src/widgets/qlistbox.cpp
+QListBoxItem* QListBox::selectedItem() const
+{
+    if ( d->selectionMode != Single )
+        return 0;
+    if ( isSelected( currentItem() ) )
+        return  d->current;
+    return 0;
+}
+*/
+QListBoxItem* QListBox_selectedItem(QListBox* cpQListBox)
+{
+    if ( cpQListBox->selectionMode() != QListBox::Single )
+    return 0;
+    if ( cpQListBox->isSelected( cpQListBox->currentItem() ) )
+    return  cpQListBox->item(cpQListBox->currentItem());
+    return 0;
+}
+#endif
+
+
 QuickOpenClassDialog::QuickOpenClassDialog(QuickOpenPart* part, QWidget* parent, \
const char* name, bool modal, WFlags fl)  : QuickOpenDialogBase( parent, name, modal, \
fl ), m_part( part ) @@ -79,5 +101,9 @@ void QuickOpenClassDialog::reject()
 void QuickOpenClassDialog::accept()
 {
+#if QT_VERSION >= 0x030100
     if( QListBoxItem* item = itemList->selectedItem() )
+#else
+    if( QListBoxItem* item = QListBox_selectedItem(itemList) )
+#endif
     {
         ClassDom klass = findClass( item->text() );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic