[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdemultimedia/kmidi
From: Waldo Bastian <bastian () kde ! org>
Date: 2003-05-13 20:17:41
[Download RAW message or body]
CVS commit by waba:
s^QUriDrag^KURLDrag^
M +13 -9 kmidi.cpp 1.121
--- kdemultimedia/kmidi/kmidi.cpp #1.120:1.121
@@ -36,4 +36,5 @@
#include <khelpmenu.h>
#include <kfiledialog.h>
+#include <kurldrag.h>
#include "kmidi.h"
@@ -248,5 +249,5 @@ int KMidi::smallPtSize()
void KMidi::dragEnterEvent( QDragEnterEvent *e )
{
- if ( QUriDrag::canDecode( e ) )
+ if ( KURLDrag::canDecode( e ) )
{
e->accept();
@@ -257,12 +258,16 @@ void KMidi::dragEnterEvent( QDragEnterEv
void KMidi::dropEvent( QDropEvent * e )
{
-
- QStringList files;
+ KURL::List files;
int newones = 0;
char mbuff[5];
- if ( QUriDrag::decodeLocalFiles( e, files ) ) {
- for (QStringList::Iterator i=files.begin(); i!=files.end(); ++i) {
+ if ( KURLDrag::decode( e, files ) ) {
+ for (KURL::List::Iterator i=files.begin(); i!=files.end(); ++i)
+ {
+ if (!(*i).isLocalFile())
+ continue;
- QFile f(*i);
+ QString file = (*i).path();
+
+ QFile f(file);
if (!f.open( IO_ReadOnly )) continue;
if (f.readBlock(mbuff, 4) != 4) {
@@ -277,6 +282,5 @@ void KMidi::dropEvent( QDropEvent * e )
f.close();
- //playlist->insert(0, *i);
- playlist->prepend(*i);
+ playlist->prepend(file);
newones++;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic