diff --git a/shell_integration/nautilus/CMakeLists.txt b/shell_integration/nautilus/CMakeLists.txt index 93824b124..45e73cfba 100644 --- a/shell_integration/nautilus/CMakeLists.txt +++ b/shell_integration/nautilus/CMakeLists.txt @@ -1,3 +1,2 @@ -configure_file(fixbranding.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fixbranding.sh) -install(FILES ${APPLICATION_EXECUTABLE}.py DESTINATION ${DATADIR}/nautilus-python/extensions) +install(FILES syncstate.py DESTINATION ${DATADIR}/nautilus-python/extensions) diff --git a/shell_integration/nautilus/fixbranding.sh.in b/shell_integration/nautilus/fixbranding.sh.in deleted file mode 100644 index 360951e50..000000000 --- a/shell_integration/nautilus/fixbranding.sh.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sed 's/oC_/@APPLICATION_EXECUTABLE@_/' ownCloud.py -mv ownCloud.py @APPLICATION_EXECUTABLE@.py diff --git a/shell_integration/nautilus/ownCloud.py b/shell_integration/nautilus/syncstate.py similarity index 85% rename from shell_integration/nautilus/ownCloud.py rename to shell_integration/nautilus/syncstate.py index 2a4c8d663..ca98fa446 100755 --- a/shell_integration/nautilus/ownCloud.py +++ b/shell_integration/nautilus/syncstate.py @@ -1,4 +1,16 @@ #!/usr/bin/python3 +# +# Copyright (C) by Klaas Freitag +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. import os import urllib @@ -6,7 +18,7 @@ import socket from gi.repository import GObject, Nautilus -class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoProvider): +class syncStateExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoProvider): nautilusVFSFile_table = {} registered_paths = {} @@ -15,15 +27,15 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP watch_id = 0 def __init__(self): - self.connectToOwnCloud + self.connectToSocketServer if not self.connected: # try again in 5 seconds - attention, logic inverted! - GObject.timeout_add(5000, self.connectToOwnCloud) + GObject.timeout_add(5000, self.connectToSocketServer) def port(self): return 34001 # Fixme, read from config file. - def connectToOwnCloud(self): + def connectToSocketServer(self): try: self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect(("localhost", self.port())) @@ -43,7 +55,7 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP print("Sending failed.") GObject.source_remove(self.watch_id) self.connected = False - GObject.timeout_add(5000, self.connectToOwnCloud) + GObject.timeout_add(5000, self.connectToSocketServer) def find_item_for_file(self, path): if path in self.nautilusVFSFile_table: @@ -116,7 +128,7 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP self.sock.close() self.connected = False GObject.source_remove(self.watch_id) - GObject.timeout_add(5000, self.connectToOwnCloud) + GObject.timeout_add(5000, self.connectToSocketServer) else: # print "We got unknown action " + action