[Pkg-owncloud-commits] [owncloud-client] 276/332: GUI: Load the finder overlay icon script on MacOSX.

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:07:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 327f70240c78e5b48371370e38a7fe7a6d1e39bb
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Fri Aug 1 14:28:34 2014 +0200

    GUI: Load the finder overlay icon script on MacOSX.
---
 src/mirall/owncloudgui.cpp | 40 +++++++++++++++++++++++++++++++++++++++-
 src/mirall/owncloudgui.h   |  1 +
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/src/mirall/owncloudgui.cpp b/src/mirall/owncloudgui.cpp
index 7de5c5c..c1c5a1e 100644
--- a/src/mirall/owncloudgui.cpp
+++ b/src/mirall/owncloudgui.cpp
@@ -84,6 +84,45 @@ ownCloudGui::ownCloudGui(Application *parent) :
              SLOT(slotShowOptionalTrayMessage(QString,QString)));
     connect( Logger::instance(), SIGNAL(guiMessage(QString,QString)),
              SLOT(slotShowGuiMessage(QString,QString)));
+
+    setupOverlayIcons();
+}
+
+// Use this to do platform specific code to make overlay icons appear
+// in the gui
+// MacOSX: perform a AppleScript code peace to load the Finder Plugin.
+
+// "tell application \"Finder\" \
+// try \
+//   «event NVTYload» \
+// end try \
+// end tell";
+
+
+void ownCloudGui::setupOverlayIcons()
+{
+
+    if( Utility::isMac() && QFile::exists("/Library/ScriptingAdditions/LiferayNativity.osax") ) {
+        QString aScript = QString::fromUtf8("tell application \"Finder\"\n"
+                                            "  try\n"
+                                            "    «event NVTYload»\n"
+                                            "  end try\n"
+                                            "end tell\n");
+
+          QString osascript = "/usr/bin/osascript";
+          QStringList processArguments;
+          // processArguments << "-l" << "AppleScript";
+
+          QProcess p;
+          p.start(osascript, processArguments);
+          p.write(aScript.toUtf8());
+          p.closeWriteChannel();
+          p.waitForReadyRead(-1);
+          QByteArray result = p.readAll();
+          QString resultAsString(result); // if appropriate
+          qDebug() << "Laod Finder Overlay-Plugin: " << resultAsString << ": " << p.exitCode()
+                   << (p.exitCode() != 0 ? p.errorString() : QString::null);
+    }
 }
 
 // This should rather be in application.... or rather in MirallConfigFile?
@@ -164,7 +203,6 @@ void ownCloudGui::startupConnected( bool connected, const QStringList& fails )
     _startupFails = fails; // store that for the settings dialog once it appears.
     if( !_settingsDialog.isNull() )
         _settingsDialog->setGeneralErrors( _startupFails );
-
 }
 
 void ownCloudGui::slotComputeOverallSyncStatus()
diff --git a/src/mirall/owncloudgui.h b/src/mirall/owncloudgui.h
index c67e43c..c042c23 100644
--- a/src/mirall/owncloudgui.h
+++ b/src/mirall/owncloudgui.h
@@ -44,6 +44,7 @@ public:
     bool checkAccountExists(bool openSettings);
 
     static void raiseDialog(QWidget *raiseWidget);
+    void setupOverlayIcons();
 
 signals:
     void setupProxy();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list