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

List:       kde-commits
Subject:    branches/KDE/4.3/kdeplasma-addons/applets/previewer
From:       Sebastian Kügler <sebas () kde ! org>
Date:       2009-08-07 16:30:53
Message-ID: 1249662653.567736.24712.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1008495 by sebas:

Fix dropping of content and creating the previewer

We should not just create the applet, but also pass in the filename so it gets \
loaded, otherwise it would be like clicking on a file, opening the default \
application for that file-type, but not actually loading the file.

Backported from trunk.

BUG:202948


 M  +9 -1      plasma-previewer.cpp  


--- branches/KDE/4.3/kdeplasma-addons/applets/previewer/plasma-previewer.cpp \
#1008494:1008495 @@ -55,6 +55,7 @@
       m_base(0),
       m_dialog(0),
       m_part(0),
+      m_currentFile(QString()),
       m_previewWidget(0)
 {
     new PreviewerAdaptor(this);
@@ -68,6 +69,10 @@
     setAcceptDrops(true);
 
     resize(PreviewWidget::suggestedWidth(), 150);
+    if (args.count()) {
+        kDebug() << "Opening file from arg passed into applet ..." << \
args.value(0).toString(); +        m_currentFile = args.value(0).toString();
+    }
 }
 
 Previewer::~Previewer()
@@ -99,6 +104,9 @@
 {
     setPopupIcon("previewer");
     setupActions();
+    if (!m_currentFile.isEmpty()) {
+        openFile(m_currentFile);
+    }
 }
 
 void Previewer::constraintsEvent(Plasma::Constraints constraints)
@@ -257,7 +265,7 @@
     m_dialog->setWindowFlags(Qt::FramelessWindowHint);
     m_dialog->show();
 
-    int buttonCode = KMessageBox::questionYesNo(m_dialog, i18n("Are you sure you \
want to remove:\n%1", cur.pathOrUrl()),  +    int buttonCode = \
KMessageBox::questionYesNo(m_dialog, i18n("Are you sure you want to remove:\n%1", \
cur.pathOrUrl()),  i18n("Deleting File"));
 
     m_dialog->setWindowFlags(Qt::X11BypassWindowManagerHint);


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

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