[Pkg-owncloud-commits] [owncloud-client] 150/164: shell_integration: Fix disappearing context menus on Windows #2898
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sun Mar 22 11:57:07 UTC 2015
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 5264a8c7f6182ff530332bce62a0aba777d93fc1
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date: Fri Mar 13 18:30:45 2015 +0100
shell_integration: Fix disappearing context menus on Windows #2898
Since each new connection to the socket API would trigger a broadcast
of REGISTER_PATH to all existing connections, opening the context menu
would trigger a SHChangeNotify call of the root directory through
the overlay icon extension, which is currently also connected to the
socket API, waiting for changes.
Fix the issue by sending the initial REGISTER_PATH automatic response
only to the connecting socket.
---
src/gui/socketapi.cpp | 18 +++++++++++++++---
src/gui/socketapi.h | 1 +
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index fa8244f..6bd86cc 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -185,8 +185,9 @@ void SocketApi::slotNewConnection()
broadcastMessage(QLatin1String("ICON_PATH"), iconPath );
#endif
- foreach( QString alias, FolderMan::instance()->map().keys() ) {
- slotRegisterPath(alias);
+ foreach( Folder *f, FolderMan::instance()->map() ) {
+ QString message = buildRegisterPathMessage(f->path());
+ sendMessage(socket, message);
}
}
@@ -226,7 +227,10 @@ void SocketApi::slotRegisterPath( const QString& alias )
{
Folder *f = FolderMan::instance()->folder(alias);
if (f) {
- broadcastMessage(QLatin1String("REGISTER_PATH"), f->path() );
+ QString message = buildRegisterPathMessage(f->path());
+ foreach(SocketType *socket, _listeners) {
+ sendMessage(socket, message);
+ }
}
}
@@ -449,6 +453,14 @@ void SocketApi::command_SHARE_MENU_TITLE(const QString &, SocketType* socket)
sendMessage(socket, QLatin1String("SHARE_MENU_TITLE:") + tr("Share with %1", "parameter is ownCloud").arg(Theme::instance()->appNameGUI()));
}
+QString SocketApi::buildRegisterPathMessage(const QString& path)
+{
+ QFileInfo fi(path);
+ QString message = QLatin1String("REGISTER_PATH:");
+ message.append(QDir::toNativeSeparators(fi.absoluteFilePath()));
+ return message;
+}
+
SqlQuery* SocketApi::getSqlQuery( Folder *folder )
{
if( !folder ) {
diff --git a/src/gui/socketapi.h b/src/gui/socketapi.h
index b6c82d9..9a38329 100644
--- a/src/gui/socketapi.h
+++ b/src/gui/socketapi.h
@@ -82,6 +82,7 @@ private:
Q_INVOKABLE void command_VERSION(const QString& argument, SocketType* socket);
Q_INVOKABLE void command_SHARE_MENU_TITLE(const QString& argument, SocketType* socket);
+ QString buildRegisterPathMessage(const QString& path);
#ifdef SOCKETAPI_TCP
QTcpServer _localServer;
--
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