diff --git a/.drone.yml b/.drone.yml index c4432e2cc..d750c5519 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,296 +1,347 @@ -clone: - git: - image: plugins/git - tags: true - depth: 1 +kind: pipeline +name: qt-5.7 -pipeline: - qt-5.7: - image: nextcloudci/client-5.7:client-5.7-4 - commands: - # Install QtKeyChain - - /bin/bash -c " - source /opt/qt57/bin/qt57-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - source /opt/qt57/bin/qt57-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.7 - qt-5.8: - image: nextcloudci/client-5.8:client-5.8-4 - commands: - # Install QtKeyChain - - /bin/bash -c " - source /opt/qt58/bin/qt58-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - source /opt/qt58/bin/qt58-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.8 - qt-5.9: - image: nextcloudci/client-5.9:client-5.9-5 - commands: - # Install QtKeyChain - - /bin/bash -c " - source /opt/qt59/bin/qt59-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - source /opt/qt59/bin/qt59-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.9 - qt-5.10: - image: nextcloudci/client-5.10:client-5.10-3 - commands: - # Install QtKeyChain - - /bin/bash -c " - export CC=gcc-7 && - export CXX=g++-7 && - source /opt/qt510/bin/qt510-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - export CC=gcc-7 && - export CXX=g++-7 && - source /opt/qt510/bin/qt510-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.10 - qt-5.11: - image: nextcloudci/client-5.11:client-5.11-3 - commands: - # Install QtKeyChain - - /bin/bash -c " - export CC=gcc-7 && - export CXX=g++-7 && - source /opt/qt511/bin/qt511-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - export CC=gcc-7 && - export CXX=g++-7 && - source /opt/qt511/bin/qt511-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.11 +steps: +- name: build and test + image: nextcloudci/client-5.7:client-5.7-4 + commands: + # Install QtKeyChain + - /bin/bash -c " + source /opt/qt57/bin/qt57-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + source /opt/qt57/bin/qt57-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push - qt-5.11-clang: - image: nextcloudci/client-5.11:client-5.11-3 - commands: - # Install QtKeyChain - - /bin/bash -c " - export CC=clang-6.0 && - export CXX=clang++-6.0 && - source /opt/qt511/bin/qt511-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - export CC=clang-6.0 && - export CXX=clang++-6.0 && - source /opt/qt511/bin/qt511-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.11-clang +--- +kind: pipeline +name: qt-5.8 - qt-5.12: - image: nextcloudci/client-5.12:client-5.12-2 - commands: - # Install QtKeyChain - - /bin/bash -c " - export CC=gcc-7 && - export CXX=g++-7 && - source /opt/qt512/bin/qt512-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - export CC=gcc-7 && - export CXX=g++-7 && - source /opt/qt512/bin/qt512-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.12 +steps: +- name: build and test + image: nextcloudci/client-5.8:client-5.8-4 + commands: + # Install QtKeyChain + - /bin/bash -c " + source /opt/qt58/bin/qt58-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + source /opt/qt58/bin/qt58-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push - qt-5.12-clang: - image: nextcloudci/client-5.12:client-5.12-2 - commands: - # Install QtKeyChain - - /bin/bash -c " - export CC=clang-6.0 && - export CXX=clang++-6.0 && - source /opt/qt512/bin/qt512-env.sh && - cd /tmp && - git clone https://github.com/frankosterfeld/qtkeychain.git && - cd qtkeychain && - git checkout v0.9.1 && - mkdir build && - cd build && - cmake ../ && - make && - make install" - # Build client - - /bin/bash -c " - export CC=clang-6.0 && - export CXX=clang++-6.0 && - source /opt/qt512/bin/qt512-env.sh && - mkdir build && - cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && - make && - useradd -m -s /bin/bash test && - chown -R test:test . && - su -c 'ctest --output-on-failure' test" - when: - matrix: - TESTS: qt-5.12-clang +--- +kind: pipeline +name: qt-5.9 - AppImage: - image: nextcloudci/client-5.12:client-5.12-2 - commands: - - /bin/bash -c "./admin/linux/build-appimage.sh" - when: - matrix: - BUILD: AppImage +steps: +- name: build and test + image: nextcloudci/client-5.9:client-5.9-5 + commands: + # Install QtKeyChain + - /bin/bash -c " + source /opt/qt59/bin/qt59-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + source /opt/qt59/bin/qt59-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push - Debian: - image: nextcloudci/client-debian-ci:client-debian-ci-2 - commands: - - /bin/bash -c "./admin/linux/debian/drone-build.sh" - secrets: [ DEBIAN_SECRET_KEY, DEBIAN_SECRET_IV ] - when: - matrix: - BUILD: Debian +--- +kind: pipeline +name: qt-5.10 - documentation: - image: nextcloudci/documentation:documentation-5 - commands: - - cd doc - - make html - when: - matrix: - TESTS: documentation +steps: +- name: build and test + image: nextcloudci/client-5.10:client-5.10-3 + commands: + # Install QtKeyChain + - /bin/bash -c " + export CC=gcc-7 && + export CXX=g++-7 && + source /opt/qt510/bin/qt510-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + export CC=gcc-7 && + export CXX=g++-7 && + source /opt/qt510/bin/qt510-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push -matrix: - include: - - TESTS: qt-5.7 - - TESTS: qt-5.8 - - TESTS: qt-5.9 - - TESTS: qt-5.10 - - TESTS: qt-5.11 - - TESTS: qt-5.11-clang - - TESTS: qt-5.12 - - TESTS: qt-5.12-clang - - BUILD: AppImage - - BUILD: Debian - - TESTS: documentation +--- +kind: pipeline +name: qt-5.11 -branches: [ master, 2.* ] +steps: +- name: build and test + image: nextcloudci/client-5.11:client-5.11-3 + commands: + # Install QtKeyChain + - /bin/bash -c " + export CC=gcc-7 && + export CXX=g++-7 && + source /opt/qt511/bin/qt511-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + export CC=gcc-7 && + export CXX=g++-7 && + source /opt/qt511/bin/qt511-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push + +--- +kind: pipeline +name: qt-5.11-clang + +steps: +- name: build and test + image: nextcloudci/client-5.11:client-5.11-3 + commands: + # Install QtKeyChain + - /bin/bash -c " + export CC=clang-6.0 && + export CXX=clang++-6.0 && + source /opt/qt511/bin/qt511-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + export CC=clang-6.0 && + export CXX=clang++-6.0 && + source /opt/qt511/bin/qt511-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push + +--- +kind: pipeline +name: qt-5.12 + +steps: +- name: build and test + image: nextcloudci/client-5.12:client-5.12-2 + commands: + # Install QtKeyChain + - /bin/bash -c " + export CC=gcc-7 && + export CXX=g++-7 && + source /opt/qt512/bin/qt512-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + export CC=gcc-7 && + export CXX=g++-7 && + source /opt/qt512/bin/qt512-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push + +--- +kind: pipeline +name: qt-5.12-clang + +steps: +- name: build and test + image: nextcloudci/client-5.12:client-5.12-2 + commands: + # Install QtKeyChain + - /bin/bash -c " + export CC=clang-6.0 && + export CXX=clang++-6.0 && + source /opt/qt512/bin/qt512-env.sh && + cd /tmp && + git clone https://github.com/frankosterfeld/qtkeychain.git && + cd qtkeychain && + git checkout v0.9.1 && + mkdir build && + cd build && + cmake ../ && + make && + make install" + # Build client + - /bin/bash -c " + export CC=clang-6.0 && + export CXX=clang++-6.0 && + source /opt/qt512/bin/qt512-env.sh && + mkdir build && + cd build && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + make && + useradd -m -s /bin/bash test && + chown -R test:test . && + su -c 'ctest --output-on-failure' test" +trigger: + branch: + - master + event: + - pull_request + - push + +--- +kind: pipeline +name: AppImage + +steps: +- name: build + image: nextcloudci/client-5.12:client-5.12-2 + commands: + - /bin/bash -c "./admin/linux/build-appimage.sh" +trigger: + branch: + - master + event: + - pull_request + - push + +--- +kind: pipeline +name: Documentation + +steps: +- name: build + image: nextcloudci/documentation:documentation-5 + commands: + - cd doc + - make html +trigger: + branch: + - master + event: + - pull_request + - push diff --git a/.tx/nextcloud.client-desktop/ar_translation b/.tx/nextcloud.client-desktop/ar_translation new file mode 100644 index 000000000..b0db3ca04 --- /dev/null +++ b/.tx/nextcloud.client-desktop/ar_translation @@ -0,0 +1,201 @@ +[Desktop Entry] +Categories=Utility;X-SuSE-SyncUtility; +Type=Application +Exec=@APPLICATION_EXECUTABLE@ +Name=@APPLICATION_NAME@ desktop sync client +Comment=@APPLICATION_NAME@ desktop synchronization client +GenericName=Folder Sync +Icon=@APPLICATION_ICON_NAME@ +Keywords=@APPLICATION_NAME@;syncing;file;sharing; +X-GNOME-Autostart-Delay=3 +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations + + +# Translations +GenericName[ar]=مزامنة المجلد diff --git a/src/gui/cloudproviders/cloudprovidermanager.cpp b/src/gui/cloudproviders/cloudprovidermanager.cpp index ee3547674..eaf2f2cb5 100644 --- a/src/gui/cloudproviders/cloudprovidermanager.cpp +++ b/src/gui/cloudproviders/cloudprovidermanager.cpp @@ -24,7 +24,7 @@ extern "C" { CloudProvidersProviderExporter *_providerExporter; -void on_bus_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data) +void on_name_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data) { Q_UNUSED(name); CloudProviderManager *self; @@ -34,6 +34,14 @@ void on_bus_acquired (GDBusConnection *connection, const gchar *name, gpointer u self->registerSignals(); } +void on_name_lost (GDBusConnection *connection, const gchar *name, gpointer user_data) +{ + Q_UNUSED(connection); + Q_UNUSED(name); + Q_UNUSED(user_data); + g_clear_object (&_providerExporter); +} + void CloudProviderManager::registerSignals() { OCC::FolderMan *folderManager = OCC::FolderMan::instance(); @@ -45,7 +53,7 @@ CloudProviderManager::CloudProviderManager(QObject *parent) : QObject(parent) { _map = new QMap(); QString busName = QString(LIBCLOUDPROVIDERS_DBUS_BUS_NAME); - g_bus_own_name (G_BUS_TYPE_SESSION, busName.toAscii().data(), G_BUS_NAME_OWNER_FLAGS_NONE, on_bus_acquired, nullptr, nullptr, this, nullptr); + g_bus_own_name (G_BUS_TYPE_SESSION, busName.toAscii().data(), G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, on_name_acquired, nullptr, this, nullptr); } void CloudProviderManager::slotFolderListChanged(const Folder::Map &folderMap) diff --git a/src/gui/cloudproviders/cloudproviderwrapper.cpp b/src/gui/cloudproviders/cloudproviderwrapper.cpp index f177f4297..62118409e 100644 --- a/src/gui/cloudproviders/cloudproviderwrapper.cpp +++ b/src/gui/cloudproviders/cloudproviderwrapper.cpp @@ -33,33 +33,25 @@ using namespace OCC; GSimpleActionGroup *actionGroup = nullptr; -static -gchar* qstring_to_gchar(const QString &string) -{ - QByteArray ba = string.toUtf8(); - char* data = ba.data(); - return g_strdup(data); -} - CloudProviderWrapper::CloudProviderWrapper(QObject *parent, Folder *folder, CloudProvidersProviderExporter* cloudprovider) : QObject(parent) , _folder(folder) { + GMenuModel *model; + GActionGroup *action_group; _recentlyChanged = new QList>(); - gchar *accountName = g_strdup_printf ("Account%sFolder%s", - qstring_to_gchar(folder->alias()), - qstring_to_gchar(folder->accountState()->account()->id())); + QString accountName = QString("Account%1Folder%2").arg(folder->alias(), folder->accountState()->account()->id()); _cloudProvider = CLOUD_PROVIDERS_PROVIDER_EXPORTER(cloudprovider); - _cloudProviderAccount = cloud_providers_account_exporter_new(_cloudProvider, accountName); + _cloudProviderAccount = cloud_providers_account_exporter_new(_cloudProvider, accountName.toUtf8().data()); - gchar* folderName = qstring_to_gchar(folder->shortGuiLocalPath()); - gchar* folderPath = qstring_to_gchar(folder->cleanPath()); - cloud_providers_account_exporter_set_name (_cloudProviderAccount, folderName); + cloud_providers_account_exporter_set_name (_cloudProviderAccount, folder->shortGuiLocalPath().toUtf8().data()); cloud_providers_account_exporter_set_icon (_cloudProviderAccount, g_icon_new_for_string(APPLICATION_ICON_NAME, nullptr)); - cloud_providers_account_exporter_set_path (_cloudProviderAccount, folderPath); + cloud_providers_account_exporter_set_path (_cloudProviderAccount, folder->cleanPath().toUtf8().data()); cloud_providers_account_exporter_set_status (_cloudProviderAccount, CLOUD_PROVIDERS_ACCOUNT_STATUS_IDLE); - cloud_providers_account_exporter_set_menu_model (_cloudProviderAccount, getMenuModel()); - cloud_providers_account_exporter_set_action_group (_cloudProviderAccount, getActionGroup()); + model = getMenuModel(); + cloud_providers_account_exporter_set_menu_model (_cloudProviderAccount, model); + action_group = getActionGroup(); + cloud_providers_account_exporter_set_action_group (_cloudProviderAccount, action_group); connect(ProgressDispatcher::instance(), SIGNAL(progressInfo(QString, ProgressInfo)), this, SLOT(slotUpdateProgress(QString, ProgressInfo))); connect(_folder, SIGNAL(syncStarted()), this, SLOT(slotSyncStarted())); @@ -68,10 +60,8 @@ CloudProviderWrapper::CloudProviderWrapper(QObject *parent, Folder *folder, Clou _paused = _folder->syncPaused(); updatePauseStatus(); - - g_free(accountName); - g_free(folderName); - g_free(folderPath); + g_clear_object (&model); + g_clear_object (&action_group); } CloudProviderWrapper::~CloudProviderWrapper() @@ -93,6 +83,16 @@ static bool shouldShowInRecentsMenu(const SyncFileItem &item) && item._instruction != CSYNC_INSTRUCTION_NONE; } +static GMenuItem *menu_item_new(const QString &label, const gchar *detailed_action) +{ + return g_menu_item_new(label.toUtf8 ().data(), detailed_action); +} + +static GMenuItem *menu_item_new_submenu(const QString &label, GMenuModel *submenu) +{ + return g_menu_item_new_submenu(label.toUtf8 ().data(), submenu); +} + void CloudProviderWrapper::slotUpdateProgress(const QString &folder, const ProgressInfo &progress) { // Only update progress for the current folder @@ -154,30 +154,25 @@ void CloudProviderWrapper::slotUpdateProgress(const QString &folder, const Progr if(!_recentlyChanged->isEmpty()) { QList>::iterator i; for (i = _recentlyChanged->begin(); i != _recentlyChanged->end(); i++) { - gchar *file; QString label = i->first; QString fullPath = i->second; - file = g_strdup(qstring_to_gchar(label)); - item = g_menu_item_new(file, "cloudprovider.showfile"); - g_menu_item_set_action_and_target_value(item, "cloudprovider.showfile", g_variant_new_string(qstring_to_gchar(fullPath))); + item = menu_item_new(label, "cloudprovider.showfile"); + g_menu_item_set_action_and_target_value(item, "cloudprovider.showfile", g_variant_new_string(fullPath.toUtf8().data())); g_menu_append_item(_recentMenu, item); + g_clear_object (&item); } } else { - item = g_menu_item_new("No recently changed files", nullptr); + item = menu_item_new(tr("No recently changed files"), nullptr); g_menu_append_item(_recentMenu, item); + g_clear_object (&item); } } } void CloudProviderWrapper::updateStatusText(QString statusText) { - char* state = qstring_to_gchar(_folder->accountState()->stateString(_folder->accountState()->state())); - char* statusChar = qstring_to_gchar(statusText); - char* status = g_strdup_printf("%s - %s", state, statusChar); - cloud_providers_account_exporter_set_status_details(_cloudProviderAccount, status); - g_free(state); - g_free(statusChar); - g_free(status); + QString status = QString("%1 - %2").arg(_folder->accountState()->stateString(_folder->accountState()->state()), statusText); + cloud_providers_account_exporter_set_status_details(_cloudProviderAccount, status.toUtf8().data()); } void CloudProviderWrapper::updatePauseStatus() @@ -217,38 +212,53 @@ GMenuModel* CloudProviderWrapper::getMenuModel() { GMenu* section; GMenuItem* item; + QString item_label; _mainMenu = g_menu_new(); section = g_menu_new(); - item = g_menu_item_new("Open website", "cloudprovider.openwebsite"); + item = menu_item_new(tr("Open website"), "cloudprovider.openwebsite"); g_menu_append_item(section, item); + g_clear_object (&item); g_menu_append_section(_mainMenu, nullptr, G_MENU_MODEL(section)); + g_clear_object (§ion); _recentMenu = g_menu_new(); - item = g_menu_item_new("No recently changed files", nullptr); + item = menu_item_new(tr("No recently changed files"), nullptr); g_menu_append_item(_recentMenu, item); - section = g_menu_new(); - item = g_menu_item_new_submenu("Recently changed", G_MENU_MODEL(_recentMenu)); - g_menu_append_item(section, item); - g_menu_append_section(_mainMenu, nullptr, G_MENU_MODEL(section)); + g_clear_object (&item); section = g_menu_new(); - item = g_menu_item_new("Pause synchronization", "cloudprovider.pause"); + item = menu_item_new_submenu(tr("Recently changed"), G_MENU_MODEL(_recentMenu)); g_menu_append_item(section, item); + g_clear_object (&item); g_menu_append_section(_mainMenu, nullptr, G_MENU_MODEL(section)); + g_clear_object (§ion); section = g_menu_new(); - item = g_menu_item_new("Help", "cloudprovider.openhelp"); - g_menu_append_item(section, item); - item = g_menu_item_new("Settings", "cloudprovider.opensettings"); - g_menu_append_item(section, item); - item = g_menu_item_new("Log out", "cloudprovider.logout"); - g_menu_append_item(section, item); - item = g_menu_item_new("Quit sync client", "cloudprovider.quit"); + item = menu_item_new(tr("Pause synchronization"), "cloudprovider.pause"); g_menu_append_item(section, item); + g_clear_object (&item); g_menu_append_section(_mainMenu, nullptr, G_MENU_MODEL(section)); + g_clear_object (§ion); + section = g_menu_new(); + item = menu_item_new(tr("Help"), "cloudprovider.openhelp"); + g_menu_append_item(section, item); + g_clear_object (&item); + item = menu_item_new(tr("Settings"), "cloudprovider.opensettings"); + g_menu_append_item(section, item); + g_clear_object (&item); + item = menu_item_new(tr("Log out"), "cloudprovider.logout"); + g_menu_append_item(section, item); + g_clear_object (&item); + item = menu_item_new(tr("Quit sync client"), "cloudprovider.quit"); + g_menu_append_item(section, item); + g_clear_object (&item); + g_menu_append_section(_mainMenu, nullptr, G_MENU_MODEL(section)); + g_clear_object (§ion); + + g_clear_object (&_recentMenu); return G_MENU_MODEL(_mainMenu); } @@ -277,11 +287,10 @@ activate_action_open (GSimpleAction *action, GVariant *parameter, gpointer user_ } if(g_str_equal(name, "showfile")) { - gchar *path; - g_variant_get (parameter, "s", &path); - g_print("showfile => %s\n", path); - showInFileManager(QString(path)); - } + const gchar *path = g_variant_get_string (parameter, NULL); + g_print("showfile => %s\n", path); + showInFileManager(QString(path)); + } if(g_str_equal(name, "logout")) { self->folder()->accountState()->signOutByUi(); @@ -331,12 +340,13 @@ static GActionEntry actions[] = { GActionGroup* CloudProviderWrapper::getActionGroup() { + g_clear_object (&actionGroup); actionGroup = g_simple_action_group_new (); g_action_map_add_action_entries (G_ACTION_MAP (actionGroup), actions, G_N_ELEMENTS (actions), this); bool state = _folder->syncPaused(); GAction *pause = g_action_map_lookup_action(G_ACTION_MAP(actionGroup), "pause"); g_simple_action_set_state(G_SIMPLE_ACTION(pause), g_variant_new_boolean(state)); - return G_ACTION_GROUP (actionGroup); + return G_ACTION_GROUP (g_object_ref (actionGroup)); } void CloudProviderWrapper::slotSyncPausedChanged(Folder *folder, bool state) diff --git a/translations/client_ja.ts b/translations/client_ja.ts index 0c8513495..9555ce454 100644 --- a/translations/client_ja.ts +++ b/translations/client_ja.ts @@ -519,7 +519,7 @@ Synced - + 同期した diff --git a/translations/client_pt_BR.ts b/translations/client_pt_BR.ts index 8eb87765c..d07531821 100644 --- a/translations/client_pt_BR.ts +++ b/translations/client_pt_BR.ts @@ -233,7 +233,7 @@ Show E2E mnemonic - Mostrar mnemônico E2E + Exibir mnemônico E2E @@ -1298,7 +1298,7 @@ Continuar a sincronização como normal fará com que todos os seus arquivos sej Show Server &Notifications - Mostrar &Notificações do Servidor + Exibir &Notificações do Servidor @@ -1339,7 +1339,7 @@ Continuar a sincronização como normal fará com que todos os seus arquivos sej Show sync folders in &Explorer's Navigation Pane - Mostrar pastas de sincronização no &Painel de Navegação do Explorer + Exibir pastas de sincronização no Painel de Navegação do &Explorer diff --git a/translations/client_sk.ts b/translations/client_sk.ts index 9280c1f4c..1e6f4a792 100644 --- a/translations/client_sk.ts +++ b/translations/client_sk.ts @@ -9,27 +9,27 @@ Checking for changes in '%1' - + Kontrolujú sa zmeny v „%1“ Syncing %1 of %2 (%3 left) - + Synchronizuje sa %1 z %2 (zostáva %3) Syncing %1 of %2 - + Synchronizuje sa %1 z %2 Syncing %1 (%2 left) - + Synchronizuje sa %1 (zostáva %2) Syncing %1 - + Synchronizuje sa %1 @@ -47,7 +47,7 @@ Dialog - + Dialóg @@ -3766,7 +3766,7 @@ Nie je vhodné ju používať. Server Address - + Adresa servera @@ -3813,22 +3813,22 @@ Nie je vhodné ju používať. %n day ago - + pred %n dňompred %n dňamipred %n dňamipred %n dňami %n days ago - + pred %n dňompred %n dňamipred %n dňamipred %n dňami %n hour ago - + pred %n hodinoupred %n hodinamipred %n hodinamipred %n hodinami %n hours ago - + pred %n hodinoupred %n hodinamipred %n hodinamipred %n hodinami @@ -3843,12 +3843,12 @@ Nie je vhodné ju používať. %n minute ago - + pred %n minútoupred %n minútamipred %n minútamipred %n minútami %n minutes ago - + pred %n minútoupred %n minútamipred %n minútamipred %n minútami @@ -3925,17 +3925,17 @@ Nie je vhodné ju používať. The checksum header is malformed. - + Hlavička kontrolného súčtu je poškodená. The checksum header contained an unknown checksum type '%1' - + Hlavička kontrolného súčtu obsahovala neznámy typ kontrolného súčtu „%1“ The downloaded file does not match the checksum, it will be resumed. - + Stiahnutý súbor nemá správny kontrolný súčet, bude stiahnutý znovu. @@ -3964,7 +3964,7 @@ Nie je vhodné ju používať. <p><small>Built from Git revision <a href="%1">%2</a> on %3, %4 using Qt %5, %6</small></p> - + <p><small>Zostavené z Git revízie <a href="%1">%2</a> na %3, %4 s použitím Qt %5, %6</small></p> @@ -4120,7 +4120,7 @@ Nie je vhodné ju používať. There was an error when launching the browser to go to URL %1. Maybe no default browser is configured? - + Pri spustení prehliadača sa vyskytla chyba, keď sa má prejsť na adresu URL %1. Možno nie je nakonfigurovaný žiadny predvolený prehliadač? @@ -4130,7 +4130,7 @@ Nie je vhodné ju používať. There was an error when launching the email client to create a new message. Maybe no default email client is configured? - + Pri vytváraní novej správy sa pri spustení e-mailového klienta vyskytla chyba. Možno nie je nakonfigurovaný žiadny predvolený e-mailový klient? \ No newline at end of file