[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeedu/kstars/kstars
From: Jason Harris <kstars () 30doradus ! org>
Date: 2005-06-06 0:12:18
Message-ID: 1118016738.549595.32696.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 422636 by harris:
Items in the draggable listboxes (in the Custom Catalogs tool) should
not be removed, if the item is dragged to some widget besides one of
the two list boxes.
M +10 -14 draglistbox.cpp
--- trunk/KDE/kdeedu/kstars/kstars/draglistbox.cpp #422635:422636
@@ -50,21 +50,19 @@
if ( i > count() + 1 ) i = count() + 1;
if ( QTextDrag::decode( evt, text ) ) {
- insertItem( text, i );
-
- //If we dragged an "Ignore item from the FieldList to the FieldPool, we don't
- //need the newly pasted item, because FieldPool already has a persistent Ignore \
item.
- if ( text == i18n("Ignore" ) && QString(evt->source()->name()) == "FieldList" && \
evt->source() != this ) {
- removeItem( i );
+ //If we dragged an "Ignore item from the FieldList to the FieldPool, then we don't
+ //need to insert the item, because FieldPool already has a persistent Ignore item.
+ if ( !( text == i18n("Ignore" ) && QString(evt->source()->name()) == "FieldList" \
&& + evt->source() != this )) {
+ insertItem( text, i );
}
- //If we dragged the "Ignore" item from FieldPool to FieldList, then restore it in \
FieldPool
- if ( text == i18n("Ignore" ) && QString(evt->source()->name()) == "FieldPool" && \
evt->source() != this ) { + //If we dragged the "Ignore" item from FieldPool to \
FieldList, then we don't + //want to remove the item from the FieldPool
+ if ( !( text == i18n("Ignore" ) && QString(evt->source()->name()) == "FieldPool" \
&& + evt->source() != this ) ) {
DragListBox *fp = (DragListBox*)evt->source();
- fp->insertItem( text, fp->ignoreIndex() );
-
- //DEBUG
- kdDebug() << "restoring \'Ignore\': " << fp->ignoreIndex() << endl;
+ fp->removeItem( fp->currentItem() );
}
}
}
@@ -88,8 +86,6 @@
QDragObject *drag = new QTextDrag( currentText(), this );
drag->dragMove();
dragging = FALSE;
-
- removeItem( currentItem() );
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic