digikam/digikam-load.diff

106 lines
3.0 KiB
Diff
Raw Normal View History

Index: digikam/digikamapp.cpp
===================================================================
--- digikam/digikam/digikamapp.cpp (Revision 502580)
+++ digikam/digikam/digikamapp.cpp (Arbeitskopie)
@@ -877,6 +877,7 @@
close();
}
+#include <dcopref.h>
QString DigikamApp::convertToLocalUrl( const QString& folder )
{
@@ -885,7 +886,36 @@
if( !url.isLocalFile() )
{
#if KDE_IS_VERSION(3,4,91)
- return KIO::NetAccess::mostLocalURL( url, 0 ).path();
+ KURL mlu = KIO::NetAccess::mostLocalURL( url, 0 );
+ if (mlu.isLocalFile())
+ return mlu.path();
+
+ kdWarning() << folder << " mlu " << mlu << endl;
+
+ QString path = mlu.path();
+
+ if ( mlu.protocol() == "system" && path.startsWith("/media") )
+ path = path.mid(7);
+ else if (mlu.protocol() == "media")
+ path = path.mid(1);
+ else
+ return folder; // nothing to see - go on
+
+ kdWarning() << "parsed import path is: " << path << endl;
+ DCOPRef ref("kded", "mediamanager");
+ DCOPReply reply = ref.call("properties", path);
+ if (reply.isValid()) {
+ QStringList slreply;
+ reply.get(slreply);
+ if ((slreply.count()>=9) && !slreply[9].isEmpty())
+ return slreply[9];
+ else
+ return slreply[6];
+ } else {
+ kdWarning() << "dcop call failed\n";
+ }
+
+ return path;
#else
#ifndef UDS_LOCAL_PATH
#define UDS_LOCAL_PATH (72 | KIO::UDS_STRING)
Index: utilities/cameragui/cameracontroller.cpp
===================================================================
--- digikam/utilities/cameragui/cameracontroller.cpp (Revision 502580)
+++ digikam/utilities/cameragui/cameracontroller.cpp (Arbeitskopie)
@@ -29,6 +29,7 @@
#include <qdatastream.h>
#include <qfile.h>
#include <qtimer.h>
+#include <qregexp.h>
#include <klocale.h>
#include <kurl.h>
@@ -486,12 +487,37 @@
d->overwriteAll = false;
d->skipAll = false;
d->downloadTotal = 0;
+ d->camera = 0;
- if (model.lower() == "directory browse")
- d->camera = new UMSCamera(model, port, path);
- else
- d->camera = new GPCamera(model, port, path);
-
+ if (path.startsWith("camera:/"))
+ {
+ KURL url(path);
+ kdDebug() << "path " << path << " " << url << " " << url.host() << endl;
+ QString xport = url.host();
+ if (xport.startsWith("usb:"))
+ {
+ kdDebug() << "xport " << xport << endl;
+ QRegExp x = QRegExp("(usb:[0-9,]*)");
+
+ if (x.search(xport) != -1) {
+ QString usbport = x.cap(1);
+ kdDebug() << "USB " << xport << " " << usbport << endl;
+ // if ((xport == usbport) || ((count == 1) && (xport == "usb:"))) {
+ // model = xmodel;
+ d->camera = new GPCamera(url.user(), "usb:", "/");
+ // }
+ }
+ }
+ }
+
+ if ( !d->camera)
+ {
+ if ( model.lower() == "directory browse" )
+ d->camera = new UMSCamera(model, port, path);
+ else
+ d->camera = new GPCamera(model, port, path);
+ }
+
d->thread = new CameraThread(this);
d->timer = new QTimer();