Comparar commits

..

35 Commits

Autor SHA1 Mensagem Data
Jenkins for ownCloud 3e954bc17f [tx-robot] updated from transifex 2016-11-04 02:18:27 +01:00
Jenkins for ownCloud 2527569bb8 [tx-robot] updated from transifex 2016-11-03 02:18:27 +01:00
Jenkins for ownCloud 1e197531cb [tx-robot] updated from transifex 2016-11-02 02:18:28 +01:00
Jenkins for ownCloud 8b876576eb [tx-robot] updated from transifex 2016-11-01 02:18:29 +01:00
Jenkins for ownCloud c110745330 [tx-robot] updated from transifex 2016-10-31 02:18:27 +01:00
Jenkins for ownCloud 19521863a0 [tx-robot] updated from transifex 2016-10-30 02:18:24 +01:00
Jenkins for ownCloud c256896165 [tx-robot] updated from transifex 2016-10-30 02:18:26 +02:00
Jenkins for ownCloud ef922f60fa [tx-robot] updated from transifex 2016-10-29 02:18:28 +02:00
Jenkins for ownCloud 733ea90e6b [tx-robot] updated from transifex 2016-10-28 02:18:28 +02:00
Jenkins for ownCloud a4e1fa9dcf [tx-robot] updated from transifex 2016-10-27 02:18:30 +02:00
Jenkins for ownCloud 1a1684ca2a [tx-robot] updated from transifex 2016-10-26 02:18:34 +02:00
Jenkins for ownCloud 9e2d3f5bc7 [tx-robot] updated from transifex 2016-10-25 02:18:32 +02:00
Jenkins for ownCloud e6be670e49 [tx-robot] updated from transifex 2016-10-24 02:18:28 +02:00
Jenkins for ownCloud 46ce2f4722 [tx-robot] updated from transifex 2016-10-23 02:18:28 +02:00
Jenkins for ownCloud 0a4806af44 [tx-robot] updated from transifex 2016-10-22 02:18:28 +02:00
Jenkins for ownCloud 641785298f [tx-robot] updated from transifex 2016-10-21 02:18:31 +02:00
Jenkins for ownCloud 1f78ea0fd1 [tx-robot] updated from transifex 2016-10-20 02:18:28 +02:00
Jenkins for ownCloud 2fd9767892 [tx-robot] updated from transifex 2016-10-19 02:18:33 +02:00
Jenkins for ownCloud f3a345a23b [tx-robot] updated from transifex 2016-10-17 02:18:29 +02:00
Jenkins for ownCloud c2c36b85cb [tx-robot] updated from transifex 2016-10-16 02:18:28 +02:00
Jenkins for ownCloud 7b2f8ae6f7 [tx-robot] updated from transifex 2016-10-15 02:18:29 +02:00
Jenkins for ownCloud 0eddcd6384 [tx-robot] updated from transifex 2016-10-14 02:18:29 +02:00
Jenkins for ownCloud 21128ed762 [tx-robot] updated from transifex 2016-10-13 02:18:28 +02:00
Jenkins for ownCloud 0d321050a6 [tx-robot] updated from transifex 2016-10-12 02:18:34 +02:00
Jenkins for ownCloud 089ecf8222 [tx-robot] updated from transifex 2016-10-11 02:18:32 +02:00
Jenkins for ownCloud d54f8adac5 [tx-robot] updated from transifex 2016-10-10 02:18:29 +02:00
Jenkins for ownCloud d35ecafa0b [tx-robot] updated from transifex 2016-10-09 02:18:27 +02:00
Jenkins for ownCloud 2ca807280a [tx-robot] updated from transifex 2016-10-08 02:18:33 +02:00
Jenkins for ownCloud e1a01c75d9 [tx-robot] updated from transifex 2016-10-06 02:18:30 +02:00
Jenkins for ownCloud 6a4adbc87e [tx-robot] updated from transifex 2016-10-05 02:18:30 +02:00
Jenkins for ownCloud 89974ab1d4 [tx-robot] updated from transifex 2016-10-04 02:18:30 +02:00
Jenkins for ownCloud 8d0c313486 [tx-robot] updated from transifex 2016-10-03 02:18:39 +02:00
Jenkins for ownCloud aab0cdf12a [tx-robot] updated from transifex 2016-10-02 02:18:29 +02:00
Jenkins for ownCloud a89520043e [tx-robot] updated from transifex 2016-10-01 02:18:30 +02:00
Jenkins for ownCloud 02c403e360 [tx-robot] updated from transifex 2016-09-30 02:18:34 +02:00
139 arquivos alterados com 917 adições e 3143 exclusões
+1 -15
Ver Arquivo
@@ -1,9 +1,6 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.8.0)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
project(client)
@@ -60,7 +57,7 @@ endif()
include(GNUInstallDirs)
include(DefineInstallationPaths)
include(GenerateExportHeader)
include(GetGitRevisionDescription)
@@ -139,13 +136,6 @@ if(OWNCLOUD_RESTORE_RENAME)
add_definitions(-DOWNCLOUD_RESTORE_RENAME=1)
endif()
# Disable shibboleth.
# So the client can be built without QtWebKit
option(NO_SHIBBOLETH "Build without Shibboleth support. Allow to build the client without QtWebKit" OFF)
if(NO_SHIBBOLETH)
message("Compiling without shibboleth")
add_definitions(-DNO_SHIBBOLETH=1)
endif()
if(APPLE)
set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
@@ -169,9 +159,6 @@ find_package(SQLite3 3.8.0 REQUIRED)
# On some OS, we want to use our own, not the system sqlite
if (USE_OUR_OWN_SQLITE3)
include_directories(BEFORE ${SQLITE3_INCLUDE_DIR})
if (WIN32)
add_definitions(-DSQLITE_API=__declspec\(dllimport\))
endif()
endif()
find_package(ZLIB)
@@ -186,7 +173,6 @@ add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
if( WIN32 )
add_definitions( -D__USE_MINGW_ANSI_STDIO=1 )
add_definitions( -DNOMINMAX )
endif( WIN32 )
# Handle Translations, pick all client_* files from trans directory.
+2 -2
Ver Arquivo
@@ -1,6 +1,6 @@
set( MIRALL_VERSION_MAJOR 2 )
set( MIRALL_VERSION_MINOR 3 )
set( MIRALL_VERSION_PATCH 0 )
set( MIRALL_VERSION_MINOR 2 )
set( MIRALL_VERSION_PATCH 5 )
set( MIRALL_VERSION_YEAR 2016 )
set( MIRALL_SOVERSION 0 )
+2 -2
Ver Arquivo
@@ -33,11 +33,11 @@ StrCpy $UNINSTALL_MESSAGEBOX "Ez dirudi ${APPLICATION_NAME} '$INSTDIR'.$ direkto
StrCpy $UNINSTALL_ABORT "Desinstalazioak erabiltzaileak bertan behera utzi du"
StrCpy $INIT_NO_QUICK_LAUNCH "Abiarazle Bizkorreko Lasterbidea (E/E)"
StrCpy $INIT_NO_DESKTOP "Mahaigaineko Lasterbidea (dagoena berridazten du)"
StrCpy $UAC_ERROR_ELEVATE "Ezin izan da goratu, errorea:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Instalatzaileak administratzaile baimenak behar ditu, saiatu berriro"
StrCpy $INIT_INSTALLER_RUNNING "Instalatzailea dagoeneko martxan da."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Desinstalatzaile honek administratzaile baimenak behar ditu, saiatu berriro"
StrCpy $UAC_ERROR_LOGON_SERVICE "Saioa hasteko zerbitzua ez dago martxan, bertan behera uzten!"
StrCpy $INIT_UNINSTALLER_RUNNING "Desinstalatzailea dagoeneko martxan da."
StrCpy $SectionGroup_Shortcuts "Lasterbideak"
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.$\r$\nSelect the operation you want to perform and click Next to continue."
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_ERROR_LOGON_SERVICE "Logon service is not running, aborting!"
+1 -1
Ver Arquivo
@@ -30,7 +30,7 @@ StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Z
StrCpy $UNINSTALLER_FILE_Detail "Zapisuji odinstal tor"
StrCpy $UNINSTALLER_REGISTRY_Detail "Zapisuji instal tor do registr…"
StrCpy $UNINSTALLER_FINISHED_Detail "DokonŸeno"
StrCpy $UNINSTALL_MESSAGEBOX "Nezd  se, §e ${APPLICATION_NAME} je nainstalov na v adres ýi '$INSTDIR'.$\n$\nChcete pokraŸovat (nedoporuŸuje se)?"
StrCpy $UNINSTALL_MESSAGEBOX "Nezd  se, §e ${APPLICATION_NAME} je nainstalov na ve slo§ce '$INSTDIR'.$\n$\nChcete pokraŸovat (nedoporuŸuje se)?"
StrCpy $UNINSTALL_ABORT "Odinstalace zruçena u§ivatelem"
StrCpy $INIT_NO_QUICK_LAUNCH "Z stupce rychlho spuçtØn¡ (nen¡ k dispozici)"
StrCpy $INIT_NO_DESKTOP "Z stupce na ploçe (pýep¡çe existuj¡c¡)"
+1 -1
Ver Arquivo
@@ -9,7 +9,7 @@ StrCpy $PageReinstall_NEW_Field_3 "
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "インストール済"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "${APPLICATION_NAME} のインストール方法を選択する"
StrCpy $PageReinstall_OLD_Field_1 "${APPLICATION_NAME} の最新バージョンがすでにインストールされています。$\n旧バージョンのインストールはお勧めしません。旧バージョンのインストールが本当に必要な場合は、まず最新バージョンをアンインストールしてから、旧バージョンをインストールしてください。$\nオペレーションを選択し、次へをクリックする。"
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} は、${VERSION} がすでにインストールされています。$\n$\n実行したい操作を選択し、次へをクリックしてください"
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} は、${VERSION} がにインストールされています。$\n$\n実行したい操作を選択し、次へをクリックする"
StrCpy $PageReinstall_SAME_Field_2 "追加/再インストールコンポーネント"
StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME} をアンインストール"
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} をアンインストール"
+8 -8
Ver Arquivo
@@ -1,14 +1,14 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostrar notas de lançamento"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Encontrados ${APPLICATION_EXECUTABLE} processo(s) em execução que precisa(m) de ser interrompido(s).$\nDeseja que o instalador o(s) termine por si?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "A terminar os processos de ${APPLICATION_EXECUTABLE}."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Não foi encontrado o processo para terminar!"
StrCpy $PageReinstall_NEW_Field_1 "Está instalada no sistema uma versão antiga de ${APPLICATION_NAME}. É recomendado que desinstale a versão atual antes de instalar a mais recente. Selecione a operação que deseja executar e clique em $\"Seguinte$\" para continuar."
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Existem ${APPLICATION_EXECUTABLE} processo(s) em execução que precisa(m) de ser interrompido(s).$\nDeseja que o instalador o(s) termine automaticamente?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "A terminar os processos ${APPLICATION_EXECUTABLE}."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Não foi encontrado o processo a terminar!"
StrCpy $PageReinstall_NEW_Field_1 "Uma versão antiga de ${APPLICATION_NAME} está instalada no sistema. É recomendado que você desinstale a versão atual antes de instalar a mais recente. Selecione a operação que deseja executar e clique em $\"Avançar$\" para continuar."
StrCpy $PageReinstall_NEW_Field_2 "Desinstalar antes de instalar"
StrCpy $PageReinstall_NEW_Field_3 "Não desinstale"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Já instalado"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Escolha como pretende instalar ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "Uma versão mais recente da aplicação ${APPLICATION_NAME} já está instalada! Não é recomendada a instalação de uma versão mais antiga. Se realmente deseja instalar esta versão, aconselha-se a desinstalação da versão atual primeiro. Selecione a operação que deseja executar e clique em Avançar para continuar."
StrCpy $PageReinstall_OLD_Field_1 "Uma versão mais recente do ${APPLICATION_NAME} já está instalada! Não é recomendada a instalação de uma versão mais antiga. Se realmente deseja instalar esta versão, aconselha-se a desinstalação da versão atual primeiro. Selecione a operação que deseja executar e clique em Avançar para continuar."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} já está instalada.$\nSelecione a operação que deseja realizar e clique em 'Seguinte' para continuar."
StrCpy $PageReinstall_SAME_Field_2 "Adicionar/Reinstalar Componentes"
StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
@@ -20,17 +20,17 @@ StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "A instalar integração para Wi
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Atalho do progama no Menu Inicial"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "A adicionar o atalho de ${APPLICATION_NAME} ao Menu Inicial."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Atalho da área de trabalho"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "A criar atalhos na área de trabalho"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "A criar atalhos da área de trabalho"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Atalho de início rápido"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "A criar atalho de início rápido"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "O essencial de ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "Atalho de ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Atalho do ambiente de trabalho para ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Atalho no ambiente de trabalho de ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Atalho de início rápido de ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_FILE_Detail "A escrever o Desinstalador"
StrCpy $UNINSTALLER_REGISTRY_Detail "A escrever chaves de registo do instalador"
StrCpy $UNINSTALLER_FINISHED_Detail "Terminado"
StrCpy $UNINSTALL_MESSAGEBOX "Não parece que a aplicação ${APPLICATION_NAME} esteja instalada no diretório '$INSTDIR'.$\n$\nContinuar na mesma (não recomendado)?"
StrCpy $UNINSTALL_MESSAGEBOX "Não parece que ${APPLICATION_NAME} esteja instalado no diretório '$INSTDIR'.$\n$\nContinuar na mesma (não recomendado)?"
StrCpy $UNINSTALL_ABORT "Desinstalação cancelada pelo utilizador"
StrCpy $INIT_NO_QUICK_LAUNCH "Atalho de Início Rápido (N/A)"
StrCpy $INIT_NO_DESKTOP "Atalho do Ambiente de Trabalho (sobrepõe o existente)"
+2 -2
Ver Arquivo
@@ -9,7 +9,6 @@ StrCpy $PageReinstall_NEW_Field_3 "Neodin
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Už je nainštalovaný"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Vyberte si, ako chcete nainštalova ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "Novšia verzia ${APPLICATION_NAME} je už nainštalovaná! Neodporúèam vám nainštalova staršiu verziu. Ak naozaj chcete nainštalova túto staršiu verziu, je lepšie najprv odinštalova aktuálnu verziu. Vyberte operáciu, ktorú chcete vykona, a kliknite na tlaèidlo Ïalej pre pokraèovanie."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} je už nainštalovaná.$\n$\nVyberte operáciu, ktorú chcete vykona, a kliknite na tlaèidlo Ïalej pre pokraèovanie."
StrCpy $PageReinstall_SAME_Field_2 "Prida/Preinštalova komponenty"
StrCpy $PageReinstall_SAME_Field_3 "Odinštalova ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinštalova ${APPLICATION_NAME}"
@@ -38,6 +37,7 @@ StrCpy $UAC_ERROR_ELEVATE "Nemo
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Tento inštalátor vyžaduje admin prístup, skúste to znova"
StrCpy $INIT_INSTALLER_RUNNING "Inštalátor je už spustený."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Tento odinštalátor vyžaduje admin prístup, skúste to znova"
StrCpy $UAC_ERROR_LOGON_SERVICE "Prihlasovacia služba nebeží! Prerušuje sa."
StrCpy $INIT_UNINSTALLER_RUNNING "Odinštalátor je už spustený."
StrCpy $SectionGroup_Shortcuts "Zástupcovia"
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.$\r$\nSelect the operation you want to perform and click Next to continue."
StrCpy $UAC_ERROR_LOGON_SERVICE "Logon service is not running, aborting!"
+1 -1
Ver Arquivo
@@ -2,7 +2,7 @@
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostrar las notas de la versión"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "El/los proceso/s ${APPLICATION_EXECUTABLE} debe/n ser detenidos.$\n¿Quiere que el instalador lo haga por usted?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Deteniendo el/los proceso/s ${APPLICATION_EXECUTABLE}."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "¡Proceso para finalizar no encontrado!"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "¡Proceso para detener no encontrado!"
StrCpy $PageReinstall_NEW_Field_1 "Una versión anterior de ${APPLICATION_NAME} se encuentra instalada en el sistema. Se recomienda de instalar la versión actual antes de instalar la nueva. Seleccione la operacion deseada y haga click en Siguiente para continuar."
StrCpy $PageReinstall_NEW_Field_2 "Desinstalar antes de instalar"
StrCpy $PageReinstall_NEW_Field_3 "No desinstalar"
+1 -1
Ver Arquivo
@@ -9,7 +9,6 @@ StrCpy $PageReinstall_NEW_Field_3 "Avinstallera inte"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Redan installerad"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Välj hur du vill installera ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "En nyare version av ${APPLICATION_NAME} är redan installerad! Det rekommenderas inte att du installerar en äldre version. Om du verkligen vill installera denna äldre versionen, är det bättre att du avinstallerar den nuvarande versionen först. Välj den åtgärd du vill utföra och klicka Nästa för att fortsätta."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} är redan installerad.$\n$\nVälj den åtgärd du vill utföra och klicka på Nästa för att fortsätta."
StrCpy $PageReinstall_SAME_Field_2 "Lägg till/Ominstallera komponenter"
StrCpy $PageReinstall_SAME_Field_3 "Avinstallera ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Avinstallera ${APPLICATION_NAME}"
@@ -41,3 +40,4 @@ StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Detta avinstallationsprogram kräver adm
StrCpy $UAC_ERROR_LOGON_SERVICE "Login-service körs inte, avbryter!"
StrCpy $INIT_UNINSTALLER_RUNNING "Avinstallationsprogrammet körs redan."
StrCpy $SectionGroup_Shortcuts "Genvägar"
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.$\r$\nSelect the operation you want to perform and click Next to continue."
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "แสดงบันทึกที่มี"
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "แสดงบันทึกประจำรุ่น"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "พบว่ากระบวนการ ${APPLICATION_EXECUTABLE} จะต้องหยุดทำงาน$\nคุณต้องการติดตั้งเพื่อหยุดการทำงานเหล่านี้ของคุณ?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "ฆ่ากระบวนการทำงาน ${APPLICATION_EXECUTABLE}"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "ไม่พบการฆ่ากระบวนการ!"
+5 -5
Ver Arquivo
@@ -2,27 +2,27 @@
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Polish"
+2 -8
Ver Arquivo
@@ -22,18 +22,12 @@ if( Qt5Core_FOUND )
find_package(Qt5Test REQUIRED)
endif()
if(NOT TOKEN_AUTH_ONLY)
find_package(Qt5WebKitWidgets REQUIRED)
find_package(Qt5WebKit REQUIRED)
find_package(Qt5Widgets REQUIRED)
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif(APPLE)
if(NOT NO_SHIBBOLETH)
find_package(Qt5WebKitWidgets)
find_package(Qt5WebKit)
if(NOT Qt5WebKitWidgets_FOUND)
message(FATAL_ERROR "Qt5WebKit required for Shibboleth. Use -DNO_SHIBBOLETH=1 to disable it.")
endif()
endif()
endif()
else( Qt5Core_FOUND )
+15 -17
Ver Arquivo
@@ -2,23 +2,21 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
else(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
else()
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
else(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
endif()
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
endif(CMAKE_COMPILER_IS_GNUCXX)
if(DEFINED MIRALL_FATAL_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif(DEFINED MIRALL_FATAL_WARNINGS)
endif()
if(DEFINED MIRALL_FATAL_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif(DEFINED MIRALL_FATAL_WARNINGS)
-2
Ver Arquivo
@@ -23,6 +23,4 @@
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#cmakedefine SHAREDIR "@SHAREDIR@"
#cmakedefine WITH_UNIT_TESTING 1
#endif
-2
Ver Arquivo
@@ -41,8 +41,6 @@ endif (MEM_NULL_TESTS)
add_subdirectory(src)
if (UNIT_TESTING)
set(WITH_UNIT_TESTING ON)
find_package(CMocka)
if (CMOCKA_FOUND)
include(AddCMockaTest)
+4
Ver Arquivo
@@ -62,4 +62,8 @@ if (WIN32)
check_function_exists(__mingw_asprintf HAVE___MINGW_ASPRINTF)
endif(WIN32)
if (UNIT_TESTING)
set(WITH_UNIT_TESTING ON)
endif (UNIT_TESTING)
set(CSYNC_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "csync required system libraries")
-13
Ver Arquivo
@@ -81,13 +81,6 @@ set(csync_HDRS
# Statically include sqlite
if (USE_OUR_OWN_SQLITE3)
list(APPEND csync_SRCS ${SQLITE3_SOURCE})
if (WIN32)
# We want to export sqlite symbols from the ocsync DLL without
# having to patch both sqlite3.h and the amalgation sqlite3.c,
# so do the import/export magic manually through the build system.
remove_definitions(-DSQLITE_API=__declspec\(dllimport\))
add_definitions(-DSQLITE_API=__declspec\(dllexport\))
endif()
endif()
include_directories(
@@ -98,12 +91,6 @@ include_directories(
add_library(${CSYNC_LIBRARY} SHARED ${csync_SRCS})
#add_library(${CSYNC_LIBRARY}_static STATIC ${csync_SRCS})
generate_export_header( ${CSYNC_LIBRARY}
BASE_NAME ${CSYNC_LIBRARY}
EXPORT_MACRO_NAME OCSYNC_EXPORT
EXPORT_FILE_NAME ocsynclib.h
)
target_link_libraries(${CSYNC_LIBRARY} ${CSYNC_LINK_LIBRARIES})
#target_link_libraries(${CSYNC_LIBRARY}_static ${CSYNC_LINK_LIBRARIES})
+3
Ver Arquivo
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdbool.h>
@@ -386,6 +387,7 @@ static int _csync_treewalk_visitor(void *obj, void *data) {
trav.inode = cur->inode;
trav.error_status = cur->error_status;
trav.should_update_metadata = cur->should_update_metadata;
trav.has_ignored_files = cur->has_ignored_files;
trav.checksum = cur->checksum;
trav.checksumTypeId = cur->checksumTypeId;
@@ -521,6 +523,7 @@ static void _csync_clean_ctx(CSYNC *ctx)
c_rbtree_free(ctx->local.tree);
c_rbtree_free(ctx->remote.tree);
SAFE_FREE(ctx->statedb.file);
SAFE_FREE(ctx->remote.root_perms);
}
+49 -49
Ver Arquivo
@@ -33,10 +33,10 @@
#define _CSYNC_H
#include "std/c_private.h"
#include "ocsynclib.h"
#include <sys/stat.h>
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <config_csync.h>
@@ -98,7 +98,6 @@ enum csync_status_codes_e {
CSYNC_STATUS_INDIVIDUAL_IS_SYMLINK,
CSYNC_STATUS_INDIVIDUAL_IGNORE_LIST,
CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS,
CSYNC_STATUS_INDIVIDUAL_TRAILING_SPACE,
CSYNC_STATUS_INDIVIDUAL_EXCLUDE_LONG_FILENAME,
CYSNC_STATUS_FILE_LOCKED_OR_OPEN,
CSYNC_STATUS_INDIVIDUAL_EXCLUDE_HIDDEN,
@@ -125,22 +124,20 @@ typedef enum csync_status_codes_e CSYNC_STATUS;
* the csync state of a file.
*/
enum csync_instructions_e {
CSYNC_INSTRUCTION_NONE = 0x00000000, /* Nothing to do (UPDATE|RECONCILE) */
CSYNC_INSTRUCTION_EVAL = 0x00000001, /* There was changed compared to the DB (UPDATE) */
CSYNC_INSTRUCTION_REMOVE = 0x00000002, /* The file need to be removed (RECONCILE) */
CSYNC_INSTRUCTION_RENAME = 0x00000004, /* The file need to be renamed (RECONCILE) */
CSYNC_INSTRUCTION_EVAL_RENAME = 0x00000800, /* The file is new, it is the destination of a rename (UPDATE) */
CSYNC_INSTRUCTION_NEW = 0x00000008, /* The file is new compared to the db (UPDATE) */
CSYNC_INSTRUCTION_CONFLICT = 0x00000010, /* The file need to be downloaded because it is a conflict (RECONCILE) */
CSYNC_INSTRUCTION_IGNORE = 0x00000020, /* The file is ignored (UPDATE|RECONCILE) */
CSYNC_INSTRUCTION_SYNC = 0x00000040, /* The file need to be pushed to the other remote (RECONCILE) */
CSYNC_INSTRUCTION_STAT_ERROR = 0x00000080,
CSYNC_INSTRUCTION_ERROR = 0x00000100,
CSYNC_INSTRUCTION_TYPE_CHANGE = 0x00000200, /* Like NEW, but deletes the old entity first (RECONCILE)
Used when the type of something changes from directory to file
or back. */
CSYNC_INSTRUCTION_UPDATE_METADATA = 0x00000400, /* If the etag has been updated and need to be writen to the db,
but without any propagation (UPDATE|RECONCILE) */
CSYNC_INSTRUCTION_NONE = 0x00000000, /* Nothing to do (UPDATE|RECONCILE) */
CSYNC_INSTRUCTION_EVAL = 0x00000001, /* There was changed compared to the DB (UPDATE) */
CSYNC_INSTRUCTION_REMOVE = 0x00000002, /* The file need to be removed (RECONCILE) */
CSYNC_INSTRUCTION_RENAME = 0x00000004, /* The file need to be renamed (RECONCILE) */
CSYNC_INSTRUCTION_EVAL_RENAME= 0x00000800, /* The file is new, it is the destination of a rename (UPDATE) */
CSYNC_INSTRUCTION_NEW = 0x00000008, /* The file is new compared to the db (UPDATE) */
CSYNC_INSTRUCTION_CONFLICT = 0x00000010, /* The file need to be downloaded because it is a conflict (RECONCILE) */
CSYNC_INSTRUCTION_IGNORE = 0x00000020, /* The file is ignored (UPDATE|RECONCILE) */
CSYNC_INSTRUCTION_SYNC = 0x00000040, /* The file need to be pushed to the other remote (RECONCILE) */
CSYNC_INSTRUCTION_STAT_ERROR = 0x00000080,
CSYNC_INSTRUCTION_ERROR = 0x00000100,
CSYNC_INSTRUCTION_TYPE_CHANGE = 0x0000200, /* Like NEW, but deletes the old entity first (RECONCILE)
Used when the type of something changes from directory to file
or back. */
};
enum csync_ftw_type_e {
@@ -229,14 +226,14 @@ struct csync_vio_file_stat_s {
char *original_name; // only set if locale conversion fails
};
csync_vio_file_stat_t OCSYNC_EXPORT *csync_vio_file_stat_new(void);
csync_vio_file_stat_t OCSYNC_EXPORT *csync_vio_file_stat_copy(csync_vio_file_stat_t *file_stat);
csync_vio_file_stat_t *csync_vio_file_stat_new(void);
csync_vio_file_stat_t *csync_vio_file_stat_copy(csync_vio_file_stat_t *file_stat);
void OCSYNC_EXPORT csync_vio_file_stat_destroy(csync_vio_file_stat_t *fstat);
void csync_vio_file_stat_destroy(csync_vio_file_stat_t *fstat);
void OCSYNC_EXPORT csync_vio_file_stat_set_file_id( csync_vio_file_stat_t* dst, const char* src );
void csync_vio_file_stat_set_file_id( csync_vio_file_stat_t* dst, const char* src );
void OCSYNC_EXPORT csync_vio_set_file_id(char* dst, const char *src );
void csync_vio_set_file_id(char* dst, const char *src );
/**
@@ -256,6 +253,9 @@ struct csync_tree_walk_file_s {
enum csync_ftw_type_e type;
enum csync_instructions_e instruction;
/* For directories: If the etag has been updated and need to be writen on the db */
int should_update_metadata;
/* For directories: Does it have children that were ignored (hidden or ignore pattern) */
int has_ignored_files;
@@ -317,7 +317,7 @@ typedef const char* (*csync_checksum_hook) (
*
* @param csync The context variable to allocate.
*/
void OCSYNC_EXPORT csync_create(CSYNC **csync, const char *local, const char *remote);
void csync_create(CSYNC **csync, const char *local, const char *remote);
/**
* @brief Initialize the file synchronizer.
@@ -326,7 +326,7 @@ void OCSYNC_EXPORT csync_create(CSYNC **csync, const char *local, const char *re
*
* @param ctx The context to initialize.
*/
void OCSYNC_EXPORT csync_init(CSYNC *ctx);
void csync_init(CSYNC *ctx);
/**
* @brief Update detection
@@ -335,7 +335,7 @@ void OCSYNC_EXPORT csync_init(CSYNC *ctx);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_update(CSYNC *ctx);
int csync_update(CSYNC *ctx);
/**
* @brief Reconciliation
@@ -344,7 +344,7 @@ int OCSYNC_EXPORT csync_update(CSYNC *ctx);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_reconcile(CSYNC *ctx);
int csync_reconcile(CSYNC *ctx);
/**
* @brief Re-initializes the csync context
@@ -353,7 +353,7 @@ int OCSYNC_EXPORT csync_reconcile(CSYNC *ctx);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_commit(CSYNC *ctx);
int csync_commit(CSYNC *ctx);
/**
* @brief Destroy the csync context
@@ -364,7 +364,7 @@ int OCSYNC_EXPORT csync_commit(CSYNC *ctx);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_destroy(CSYNC *ctx);
int csync_destroy(CSYNC *ctx);
/**
* @brief Get the userdata saved in the context.
@@ -386,7 +386,7 @@ void *csync_get_userdata(CSYNC *ctx);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_set_userdata(CSYNC *ctx, void *userdata);
int csync_set_userdata(CSYNC *ctx, void *userdata);
/**
* @brief Get the authentication callback set.
@@ -396,7 +396,7 @@ int OCSYNC_EXPORT csync_set_userdata(CSYNC *ctx, void *userdata);
* @return The authentication callback set or NULL if an error
* occurred.
*/
csync_auth_callback OCSYNC_EXPORT csync_get_auth_callback(CSYNC *ctx);
csync_auth_callback csync_get_auth_callback(CSYNC *ctx);
/**
* @brief Set the authentication callback.
@@ -407,7 +407,7 @@ csync_auth_callback OCSYNC_EXPORT csync_get_auth_callback(CSYNC *ctx);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb);
int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb);
/**
* @brief Set the log level.
@@ -416,14 +416,14 @@ int OCSYNC_EXPORT csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb);
*
* @return 0 on success, < 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_set_log_level(int level);
int csync_set_log_level(int level);
/**
* @brief Get the log verbosity
*
* @return The log verbosity, -1 on error.
*/
int OCSYNC_EXPORT csync_get_log_level(void);
int csync_get_log_level(void);
/**
* @brief Get the logging callback set.
@@ -431,7 +431,7 @@ int OCSYNC_EXPORT csync_get_log_level(void);
* @return The logging callback set or NULL if an error
* occurred.
*/
csync_log_callback OCSYNC_EXPORT csync_get_log_callback(void);
csync_log_callback csync_get_log_callback(void);
/**
* @brief Set the logging callback.
@@ -440,14 +440,14 @@ csync_log_callback OCSYNC_EXPORT csync_get_log_callback(void);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_set_log_callback(csync_log_callback cb);
int csync_set_log_callback(csync_log_callback cb);
/**
* @brief get the userdata set for the logging callback.
*
* @return The userdata or NULL.
*/
void OCSYNC_EXPORT *csync_get_log_userdata(void);
void *csync_get_log_userdata(void);
/**
* @brief Set the userdata passed to the logging callback.
@@ -456,13 +456,13 @@ void OCSYNC_EXPORT *csync_get_log_userdata(void);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_set_log_userdata(void *data);
int csync_set_log_userdata(void *data);
/* Used for special modes or debugging */
CSYNC_STATUS OCSYNC_EXPORT csync_get_status(CSYNC *ctx);
CSYNC_STATUS csync_get_status(CSYNC *ctx);
/* Used for special modes or debugging */
int OCSYNC_EXPORT csync_set_status(CSYNC *ctx, int status);
int csync_set_status(CSYNC *ctx, int status);
typedef int csync_treewalk_visit_func(TREE_WALK_FILE* ,void*);
@@ -475,7 +475,7 @@ typedef int csync_treewalk_visit_func(TREE_WALK_FILE* ,void*);
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_walk_local_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter);
int csync_walk_local_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter);
/**
* @brief Walk the remote file tree and call a visitor function for each file.
@@ -486,7 +486,7 @@ int OCSYNC_EXPORT csync_walk_local_tree(CSYNC *ctx, csync_treewalk_visit_func *v
*
* @return 0 on success, less than 0 if an error occurred.
*/
int OCSYNC_EXPORT csync_walk_remote_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter);
int csync_walk_remote_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter);
/**
* @brief Get the csync status string.
@@ -495,7 +495,7 @@ int OCSYNC_EXPORT csync_walk_remote_tree(CSYNC *ctx, csync_treewalk_visit_func *
*
* @return A const pointer to a string with more precise status info.
*/
const char OCSYNC_EXPORT *csync_get_status_string(CSYNC *ctx);
const char *csync_get_status_string(CSYNC *ctx);
#ifdef WITH_ICONV
/**
@@ -505,7 +505,7 @@ const char OCSYNC_EXPORT *csync_get_status_string(CSYNC *ctx);
*
* @return 0 on success, or an iconv error number.
*/
int OCSYNC_EXPORT csync_set_iconv_codec(const char *from);
int csync_set_iconv_codec(const char *from);
#endif
/**
@@ -513,24 +513,24 @@ int OCSYNC_EXPORT csync_set_iconv_codec(const char *from);
*
* @param ctx The csync context.
*/
void OCSYNC_EXPORT csync_request_abort(CSYNC *ctx);
void csync_request_abort(CSYNC *ctx);
/**
* @brief Clears the abort flag. Can be called from another thread.
*
* @param ctx The csync context.
*/
void OCSYNC_EXPORT csync_resume(CSYNC *ctx);
void csync_resume(CSYNC *ctx);
/**
* @brief Checks for the abort flag, to be used from the modules.
*
* @param ctx The csync context.
*/
int OCSYNC_EXPORT csync_abort_requested(CSYNC *ctx);
int csync_abort_requested(CSYNC *ctx);
char OCSYNC_EXPORT *csync_normalize_etag(const char *);
time_t OCSYNC_EXPORT oc_httpdate_parse( const char *date );
char *csync_normalize_etag(const char *);
time_t oc_httpdate_parse( const char *date );
#ifdef __cplusplus
}
+5 -15
Ver Arquivo
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "c_lib.h"
#include "c_private.h"
@@ -36,16 +37,10 @@
#include "csync_exclude.h"
#include "csync_misc.h"
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#define CSYNC_LOG_CATEGORY_NAME "csync.exclude"
#include "csync_log.h"
#ifndef WITH_UNIT_TESTING
#ifndef NDEBUG
static
#endif
int _csync_exclude_add(c_strlist_t **inList, const char *string) {
@@ -248,14 +243,9 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(c_strlist_t *excludes, const ch
// distinguish files ending in '.' from files without an ending,
// as '.' is a separator that is not stored internally, so let's
// not allow to sync those to avoid file loss/ambiguities (#416)
if (blen > 1) {
if (bname[blen-1]== ' ') {
match = CSYNC_FILE_EXCLUDE_TRAILING_SPACE;
goto out;
} else if (bname[blen-1]== '.' ) {
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
goto out;
}
if (blen > 1 && (bname[blen-1]== ' ' || bname[blen-1]== '.' )) {
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
goto out;
}
if (csync_is_windows_reserved_word(bname)) {
+4 -7
Ver Arquivo
@@ -21,23 +21,20 @@
#ifndef _CSYNC_EXCLUDE_H
#define _CSYNC_EXCLUDE_H
#include "ocsynclib.h"
enum csync_exclude_type_e {
CSYNC_NOT_EXCLUDED = 0,
CSYNC_FILE_SILENTLY_EXCLUDED,
CSYNC_FILE_EXCLUDE_AND_REMOVE,
CSYNC_FILE_EXCLUDE_LIST,
CSYNC_FILE_EXCLUDE_INVALID_CHAR,
CSYNC_FILE_EXCLUDE_TRAILING_SPACE,
CSYNC_FILE_EXCLUDE_LONG_FILENAME,
CSYNC_FILE_EXCLUDE_HIDDEN,
CSYNC_FILE_EXCLUDE_STAT_FAILED
};
typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
#ifdef WITH_UNIT_TESTING
int OCSYNC_EXPORT _csync_exclude_add(c_strlist_t **inList, const char *string);
#ifdef NDEBUG
int _csync_exclude_add(c_strlist_t **inList, const char *string);
#endif
/**
@@ -48,7 +45,7 @@ int OCSYNC_EXPORT _csync_exclude_add(c_strlist_t **inList, const char *string);
*
* @return 0 on success, -1 if an error occurred with errno set.
*/
int OCSYNC_EXPORT csync_exclude_load(const char *fname, c_strlist_t **list);
int csync_exclude_load(const char *fname, c_strlist_t **list);
/**
* @brief Check if the given path should be excluded in a traversal situation.
@@ -74,7 +71,7 @@ CSYNC_EXCLUDE_TYPE csync_excluded_traversal(c_strlist_t *excludes, const char *p
* @param filetype
* @return
*/
CSYNC_EXCLUDE_TYPE OCSYNC_EXPORT csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype);
CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype);
#endif /* _CSYNC_EXCLUDE_H */
/**
+42 -1
Ver Arquivo
@@ -23,6 +23,12 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#ifndef _WIN32
#include <sys/time.h>
#else
#include <sys/utime.h>
#endif
#include <time.h>
#include "csync_private.h"
#include "csync_log.h"
@@ -31,11 +37,46 @@ CSYNC_THREAD int csync_log_level;
CSYNC_THREAD csync_log_callback csync_log_cb;
CSYNC_THREAD void *csync_log_userdata;
static int current_timestring(int hires, char *buf, size_t len)
{
char tbuf[64];
struct timeval tv;
struct tm *tm;
time_t t;
gettimeofday(&tv, NULL);
t = (time_t) tv.tv_sec;
tm = localtime(&t);
if (tm == NULL) {
return -1;
}
if (hires) {
strftime(tbuf, sizeof(tbuf) - 1, "%Y/%m/%d %H:%M:%S", tm);
snprintf(buf, len, "%s.%06ld", tbuf, (long) tv.tv_usec);
} else {
strftime(tbuf, sizeof(tbuf) - 1, "%Y/%m/%d %H:%M:%S", tm);
snprintf(buf, len, "%s", tbuf);
}
return 0;
}
static void csync_log_stderr(int verbosity,
const char *function,
const char *buffer)
{
fprintf(stderr, "[%d] %s", verbosity, function);
char date[64] = {0};
int rc;
rc = current_timestring(1, date, sizeof(date));
if (rc == 0) {
fprintf(stderr, "[%s, %d] %s:", date+5, verbosity, function);
} else {
fprintf(stderr, "[%d] %s", verbosity, function);
}
fprintf(stderr, " %s\n", buffer);
}
static void csync_log_function(int verbosity,
+1
Ver Arquivo
@@ -39,6 +39,7 @@
# include <shlobj.h>
#else /* _WIN32 */
# include <pwd.h>
# include <unistd.h>
#endif /* _WIN32 */
#include "c_lib.h"
+1 -1
Ver Arquivo
@@ -36,7 +36,7 @@
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
int csync_fnmatch(const char *pattern, const char *name, int flags);
int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags);
/**
* @brief csync_errno_to_status - errno to csync status code
+5
Ver Arquivo
@@ -186,6 +186,8 @@ struct csync_file_stat_s {
mode_t mode; /* u32 */
unsigned int type : 4;
unsigned int child_modified : 1;
unsigned int should_update_metadata : 1; /*specify that the etag, or the remote perm or fileid has
changed and need to be updated on the db even for INSTRUCTION_NONE */
unsigned int has_ignored_files : 1; /* specify that a directory, or child directory contains ignored files */
char *destpath; /* for renames */
@@ -224,6 +226,9 @@ struct _csync_treewalk_context_s
};
typedef struct _csync_treewalk_context_s _csync_treewalk_context;
time_t oc_httpdate_parse( const char *date );
void set_errno_from_http_errcode( int err );
/**
+31 -30
Ver Arquivo
@@ -20,7 +20,6 @@
#include "config_csync.h"
#include <assert.h>
#include "csync_private.h"
#include "csync_reconcile.h"
#include "csync_util.h"
@@ -131,7 +130,6 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
break;
/* file has been removed on the opposite replica */
case CSYNC_INSTRUCTION_NONE:
case CSYNC_INSTRUCTION_UPDATE_METADATA:
if (cur->has_ignored_files) {
/* Do not remove a directory that has ignored files */
break;
@@ -183,8 +181,13 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
if(!other) {
cur->instruction = CSYNC_INSTRUCTION_NEW;
if (cur->type == CSYNC_FTW_TYPE_DIR) {
// For new directories we always want to update the etag once
// the directory has been propagated. Otherwise the directory
// could appear locally without being added to the database.
cur->should_update_metadata = true;
}
} else if (other->instruction == CSYNC_INSTRUCTION_NONE
|| other->instruction == CSYNC_INSTRUCTION_UPDATE_METADATA
|| cur->type == CSYNC_FTW_TYPE_DIR) {
other->instruction = CSYNC_INSTRUCTION_RENAME;
other->destpath = c_strdup( cur->path );
@@ -192,6 +195,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
csync_vio_set_file_id( other->file_id, cur->file_id );
}
other->inode = cur->inode;
other->should_update_metadata = true;
cur->instruction = CSYNC_INSTRUCTION_NONE;
} else if (other->instruction == CSYNC_INSTRUCTION_REMOVE) {
other->instruction = CSYNC_INSTRUCTION_RENAME;
@@ -201,12 +205,12 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
csync_vio_set_file_id( other->file_id, cur->file_id );
}
other->inode = cur->inode;
other->should_update_metadata = true;
cur->instruction = CSYNC_INSTRUCTION_NONE;
} else if (other->instruction == CSYNC_INSTRUCTION_NEW) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "OOOO=> NEW detected in other tree!");
cur->instruction = CSYNC_INSTRUCTION_CONFLICT;
} else {
assert(other->type != CSYNC_FTW_TYPE_DIR);
cur->instruction = CSYNC_INSTRUCTION_NONE;
other->instruction = CSYNC_INSTRUCTION_SYNC;
}
@@ -218,19 +222,13 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
break;
}
} else {
bool is_conflict = true;
bool is_equal_files = false;
/*
* file found on the other replica
*/
other = (csync_file_stat_t *) node->data;
switch (cur->instruction) {
case CSYNC_INSTRUCTION_UPDATE_METADATA:
if (other->instruction == CSYNC_INSTRUCTION_UPDATE_METADATA && ctx->current == LOCAL_REPLICA) {
// Remote wins, the SyncEngine will pick relevant local metadata since the remote tree is walked last.
cur->instruction = CSYNC_INSTRUCTION_NONE;
}
break;
case CSYNC_INSTRUCTION_EVAL_RENAME:
/* If the file already exist on the other side, we have a conflict.
Abort the rename and consider it is a new file. */
@@ -255,39 +253,42 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
case CSYNC_INSTRUCTION_EVAL:
if (other->type == CSYNC_FTW_TYPE_DIR &&
cur->type == CSYNC_FTW_TYPE_DIR) {
// Folders of the same path are always considered equals
is_conflict = false;
is_equal_files = (other->modtime == cur->modtime);
} else {
is_conflict = ((other->size != cur->size) || (other->modtime != cur->modtime));
is_equal_files = ((other->size == cur->size) && (other->modtime == cur->modtime));
// FIXME: do a binary comparision of the file here because of the following
// edge case:
// The files could still have different content, even though the mtime
// and size are the same.
}
if (ctx->current == REMOTE_REPLICA) {
// If the files are considered equal, only update the DB with the etag from remote
cur->instruction = is_conflict ? CSYNC_INSTRUCTION_CONFLICT : CSYNC_INSTRUCTION_UPDATE_METADATA;
other->instruction = CSYNC_INSTRUCTION_NONE;
} else {
if (is_equal_files) {
/* The files are considered equal. */
cur->instruction = CSYNC_INSTRUCTION_NONE;
other->instruction = is_conflict ? CSYNC_INSTRUCTION_CONFLICT : CSYNC_INSTRUCTION_UPDATE_METADATA;
other->instruction = CSYNC_INSTRUCTION_NONE;
/* update DB with new etag from remote */
if (ctx->current == LOCAL_REPLICA) {
other->should_update_metadata = true;
} else {
cur->should_update_metadata = true;
}
} else if(ctx->current == REMOTE_REPLICA) {
cur->instruction = CSYNC_INSTRUCTION_CONFLICT;
other->instruction = CSYNC_INSTRUCTION_NONE;
} else {
cur->instruction = CSYNC_INSTRUCTION_NONE;
other->instruction = CSYNC_INSTRUCTION_CONFLICT;
}
break;
/* file on the other replica has not been modified */
case CSYNC_INSTRUCTION_NONE:
case CSYNC_INSTRUCTION_UPDATE_METADATA:
if (cur->type != other->type) {
// If the type of the entity changed, it's like NEW, but
// needs to delete the other entity first.
cur->instruction = CSYNC_INSTRUCTION_TYPE_CHANGE;
other->instruction = CSYNC_INSTRUCTION_NONE;
} else if (cur->type == CSYNC_FTW_TYPE_DIR) {
cur->instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
other->instruction = CSYNC_INSTRUCTION_NONE;
} else {
cur->instruction = CSYNC_INSTRUCTION_SYNC;
other->instruction = CSYNC_INSTRUCTION_NONE;
}
break;
case CSYNC_INSTRUCTION_IGNORE:
@@ -309,7 +310,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
if(cur->type == CSYNC_FTW_TYPE_DIR)
{
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE,
"%-30s %s dir: %s",
"%-20s %s dir: %s",
csync_instruction_str(cur->instruction),
repo,
cur->path);
@@ -317,7 +318,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
else
{
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE,
"%-30s %s file: %s",
"%-20s %s file: %s",
csync_instruction_str(cur->instruction),
repo,
cur->path);
@@ -328,7 +329,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
if(cur->type == CSYNC_FTW_TYPE_DIR)
{
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
"%-30s %s dir: %s",
"%-20s %s dir: %s",
csync_instruction_str(cur->instruction),
repo,
cur->path);
@@ -336,7 +337,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
else
{
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
"%-30s %s file: %s",
"%-20s %s file: %s",
csync_instruction_str(cur->instruction),
repo,
cur->path);
+1 -1
Ver Arquivo
@@ -50,7 +50,7 @@
*
* @todo Add an argument to set the algorithm to use.
*/
int OCSYNC_EXPORT csync_reconcile_updates(CSYNC *ctx);
int csync_reconcile_updates(CSYNC *ctx);
/**
* }@
+4 -4
Ver Arquivo
@@ -27,11 +27,11 @@ extern "C" {
#endif
/* Return the final destination path of a given patch in case of renames */
char OCSYNC_EXPORT *csync_rename_adjust_path(CSYNC *ctx, const char *path);
char *csync_rename_adjust_path(CSYNC *ctx, const char *path);
/* Return the source of a given path in case of renames */
char OCSYNC_EXPORT *csync_rename_adjust_path_source(CSYNC *ctx, const char *path);
void OCSYNC_EXPORT csync_rename_destroy(CSYNC *ctx);
void OCSYNC_EXPORT csync_rename_record(CSYNC *ctx, const char *from, const char *to);
char *csync_rename_adjust_path_source(CSYNC *ctx, const char *path);
void csync_rename_destroy(CSYNC *ctx);
void csync_rename_record(CSYNC *ctx, const char *from, const char *to);
#ifdef __cplusplus
}
+7 -4
Ver Arquivo
@@ -27,6 +27,7 @@
#include <sqlite3.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -52,7 +53,7 @@
#define sqlite_open(A, B) sqlite3_open_v2(A,B, SQLITE_OPEN_READONLY+SQLITE_OPEN_NOMUTEX, NULL)
#define SQLTM_TIME 150
#define SQLTM_TIME 150000
#define SQLTM_COUNT 10
#define SQLITE_BUSY_HANDLED(F) if(1) { \
@@ -60,7 +61,7 @@
do { rc = F ; \
if( (rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED) ) { \
n++; \
csync_sleep(SQLTM_TIME); \
usleep(SQLTM_TIME); \
} \
}while( (n < SQLTM_COUNT) && ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED))); \
}
@@ -518,7 +519,8 @@ c_strlist_t *csync_statedb_query(sqlite3 *db,
/* compile SQL program into a virtual machine, reattempteing if busy */
do {
if (busy_count) {
csync_sleep(100);
/* sleep 100 msec */
usleep(100000);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "sqlite3_prepare: BUSY counter: %zu", busy_count);
}
err = sqlite3_prepare(db, statement, -1, &stmt, &tail);
@@ -545,7 +547,8 @@ c_strlist_t *csync_statedb_query(sqlite3 *db,
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Busy counter has reached its maximum. Aborting this sql statement");
break;
}
csync_sleep(100);
/* sleep 100 msec */
usleep(100000);
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "sqlite3_step: BUSY counter: %zu", busy_count);
continue;
}
+2 -20
Ver Arquivo
@@ -31,11 +31,6 @@
#include "csync_time.h"
#include "vio/csync_vio.h"
#ifndef _WIN32
#include <unistd.h>
#include <sys/time.h>
#endif
#define CSYNC_LOG_CATEGORY_NAME "csync.time"
#include "csync_log.h"
@@ -50,13 +45,7 @@
int csync_gettime(struct timespec *tp)
{
#if defined(_WIN32)
__int64 wintime;
GetSystemTimeAsFileTime((FILETIME*)&wintime);
wintime -= 116444736000000000ll; //1jan1601 to 1jan1970
tp->tv_sec = wintime / 10000000ll; //seconds
tp->tv_nsec = wintime % 10000000ll * 100; //nano-seconds
#elif defined(HAVE_CLOCK_GETTIME)
#ifdef HAVE_CLOCK_GETTIME
return clock_gettime(CSYNC_CLOCK, tp);
#else
struct timeval tv;
@@ -73,11 +62,4 @@ int csync_gettime(struct timespec *tp)
#undef CSYNC_CLOCK
void csync_sleep(unsigned int msecs)
{
#if defined(_WIN32)
Sleep(msecs);
#else
usleep(msecs * 1000);
#endif
}
/* vim: set ts=8 sw=2 et cindent: */
-1
Ver Arquivo
@@ -26,6 +26,5 @@
#include "csync_private.h"
int csync_gettime(struct timespec *tp);
void csync_sleep(unsigned int msecs);
#endif /* _CSYNC_TIME_H */
+19 -18
Ver Arquivo
@@ -314,7 +314,8 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
}
if (checksumIdentical) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "NOTE: Checksums are identical, file did not actually change: %s", path);
st->instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
st->instruction = CSYNC_INSTRUCTION_NONE;
st->should_update_metadata = true;
goto out;
}
}
@@ -340,19 +341,18 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Reading from database: %s", path);
ctx->remote.read_from_db = true;
}
if (metadata_differ) {
/* file id or permissions has changed. Which means we need to update them in the DB. */
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Need to update metadata for: %s", path);
st->should_update_metadata = true;
}
/* If it was remembered in the db that the remote dir has ignored files, store
* that so that the reconciler can make advantage of.
*/
if( ctx->current == REMOTE_REPLICA ) {
st->has_ignored_files = tmp->has_ignored_files;
}
if (metadata_differ) {
/* file id or permissions has changed. Which means we need to update them in the DB. */
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Need to update metadata for: %s", path);
st->instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
} else {
st->instruction = CSYNC_INSTRUCTION_NONE;
}
st->instruction = CSYNC_INSTRUCTION_NONE;
} else {
enum csync_vio_file_type_e tmp_vio_type = CSYNC_VIO_FILE_TYPE_UNKNOWN;
@@ -477,8 +477,6 @@ out:
st->error_status = CSYNC_STATUS_INDIVIDUAL_IGNORE_LIST; /* File listed on ignore list. */
} else if (excluded == CSYNC_FILE_EXCLUDE_INVALID_CHAR) {
st->error_status = CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS; /* File contains invalid characters. */
} else if (excluded == CSYNC_FILE_EXCLUDE_TRAILING_SPACE) {
st->error_status = CSYNC_STATUS_INDIVIDUAL_TRAILING_SPACE; /* File ends with a trailing space. */
} else if (excluded == CSYNC_FILE_EXCLUDE_LONG_FILENAME) {
st->error_status = CSYNC_STATUS_INDIVIDUAL_EXCLUDE_LONG_FILENAME; /* File name is too long. */
} else if (excluded == CSYNC_FILE_EXCLUDE_HIDDEN ) {
@@ -488,9 +486,7 @@ out:
}
}
}
if (st->instruction != CSYNC_INSTRUCTION_NONE
&& st->instruction != CSYNC_INSTRUCTION_IGNORE
&& st->instruction != CSYNC_INSTRUCTION_UPDATE_METADATA
if (st->instruction != CSYNC_INSTRUCTION_NONE && st->instruction != CSYNC_INSTRUCTION_IGNORE
&& type != CSYNC_FTW_TYPE_DIR) {
st->child_modified = 1;
}
@@ -879,11 +875,10 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
if (ctx->current_fs && !ctx->current_fs->child_modified
&& ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL) {
if (ctx->current == REMOTE_REPLICA) {
ctx->current_fs->instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
} else {
ctx->current_fs->instruction = CSYNC_INSTRUCTION_NONE;
}
ctx->current_fs->instruction = CSYNC_INSTRUCTION_NONE;
if (ctx->current == REMOTE_REPLICA) {
ctx->current_fs->should_update_metadata = true;
}
}
if (ctx->current_fs && previous_fs && ctx->current_fs->has_ignored_files) {
@@ -897,6 +892,12 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
previous_fs->child_modified = ctx->current_fs->child_modified;
}
if (flag == CSYNC_FTW_FLAG_DIR && ctx->current_fs
&& (ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL ||
ctx->current_fs->instruction == CSYNC_INSTRUCTION_NEW)) {
ctx->current_fs->should_update_metadata = true;
}
ctx->current_fs = previous_fs;
ctx->remote.read_from_db = read_from_db;
SAFE_FREE(filename);
-1
Ver Arquivo
@@ -56,7 +56,6 @@ static const _instr_code_struct _instr[] =
{ "INSTRUCTION_STAT_ERR", CSYNC_INSTRUCTION_STAT_ERROR },
{ "INSTRUCTION_ERROR", CSYNC_INSTRUCTION_ERROR },
{ "INSTRUCTION_TYPE_CHANGE", CSYNC_INSTRUCTION_TYPE_CHANGE },
{ "INSTRUCTION_UPDATE_METADATA", CSYNC_INSTRUCTION_UPDATE_METADATA },
{ NULL, CSYNC_INSTRUCTION_ERROR }
};
+3 -3
Ver Arquivo
@@ -26,9 +26,9 @@
#include "csync_private.h"
const char OCSYNC_EXPORT *csync_instruction_str(enum csync_instructions_e instr);
const char *csync_instruction_str(enum csync_instructions_e instr);
void OCSYNC_EXPORT csync_memstat_check(void);
void csync_memstat_check(void);
bool OCSYNC_EXPORT csync_file_locked_or_open( const char *dir, const char *fname);
bool csync_file_locked_or_open( const char *dir, const char *fname);
#endif /* _CSYNC_UTIL_H */
-6
Ver Arquivo
@@ -26,12 +26,6 @@ set(cstdlib_SRCS
c_time.c
)
if(NOT HAVE_ASPRINTF AND NOT HAVE___MINGW_ASPRINTF)
list(APPEND cstdlib_SRCS
asprintf.c
)
endif()
include_directories(
${CSTDLIB_PUBLIC_INCLUDE_DIRS}
${CSTDLIB_PRIVATE_INCLUDE_DIRS}
-90
Ver Arquivo
@@ -1,90 +0,0 @@
/*
https://raw.githubusercontent.com/littlstar/asprintf.c/20ce5207a4ecb24017b5a17e6cd7d006e3047146/asprintf.c
The MIT License (MIT)
Copyright (c) 2014 Little Star Media, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* `asprintf.c' - asprintf
*
* copyright (c) 2014 joseph werle <joseph.werle@gmail.com>
*/
#ifndef HAVE_ASPRINTF
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "asprintf.h"
int
asprintf (char **str, const char *fmt, ...) {
int size = 0;
va_list args;
// init variadic argumens
va_start(args, fmt);
// format and get size
size = vasprintf(str, fmt, args);
// toss args
va_end(args);
return size;
}
int
vasprintf (char **str, const char *fmt, va_list args) {
int size = 0;
va_list tmpa;
// copy
va_copy(tmpa, args);
// apply variadic arguments to
// sprintf with format to get size
size = vsnprintf(NULL, size, fmt, tmpa);
// toss args
va_end(tmpa);
// return -1 to be compliant if
// size is less than 0
if (size < 0) { return -1; }
// alloc with size plus 1 for `\0'
*str = (char *) malloc(size + 1);
// return -1 to be compliant
// if pointer is `NULL'
if (NULL == *str) { return -1; }
// format string with original
// variadic arguments and set new size
size = vsprintf(*str, fmt, args);
return size;
}
#endif
-60
Ver Arquivo
@@ -1,60 +0,0 @@
/*
https://raw.githubusercontent.com/littlstar/asprintf.c/20ce5207a4ecb24017b5a17e6cd7d006e3047146/asprintf.h
The MIT License (MIT)
Copyright (c) 2014 Little Star Media, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* `asprintf.h' - asprintf.c
*
* copyright (c) 2014 joseph werle <joseph.werle@gmail.com>
*/
#ifndef HAVE_ASPRINTF
#ifndef ASPRINTF_H
#define ASPRINTF_H 1
#include <stdarg.h>
/**
* Sets `char **' pointer to be a buffer
* large enough to hold the formatted string
* accepting a `va_list' args of variadic
* arguments.
*/
int
vasprintf (char **, const char *, va_list);
/**
* Sets `char **' pointer to be a buffer
* large enough to hold the formatted
* string accepting `n' arguments of
* variadic arguments.
*/
int
asprintf (char **, const char *, ...);
#endif
#endif
+2 -11
Ver Arquivo
@@ -31,17 +31,14 @@
#include <sys/stat.h>
#ifdef _WIN32
#include <windows.h>
#include <windef.h>
#include <winbase.h>
#include <wchar.h>
#else
#include <unistd.h>
#endif
#include <errno.h>
#ifdef __MINGW32__
#ifdef _WIN32
#define EDQUOT 0
#define ENODATA 0
#ifndef S_IRGRP
@@ -68,8 +65,6 @@
#define nlink_t int
#define getuid() 0
#define geteuid() 0
#elif defined(_WIN32)
#define mode_t int
#else
#include <fcntl.h>
#endif
@@ -94,12 +89,8 @@ typedef struct stat csync_stat_t;
#define ENODATA EBADF
#endif
#if !defined(HAVE_ASPRINTF)
#if defined(HAVE___MINGW_ASPRINTF)
#if !defined(HAVE_ASPRINTF) && defined(HAVE___MINGW_ASPRINTF)
#define asprintf __mingw_asprintf
#else
#include "asprintf.h"
#endif
#endif
#ifndef HAVE_STRERROR_R
-4
Ver Arquivo
@@ -25,10 +25,6 @@
#include "c_path.h"
#include "c_time.h"
#ifndef _WIN32
#include <sys/time.h>
#endif
struct timespec c_tspecdiff(struct timespec time1, struct timespec time0) {
struct timespec ret;
int xsec = 0;
+1
Ver Arquivo
@@ -22,6 +22,7 @@
#define _C_TIME_H
#include <time.h>
#include <sys/time.h>
/**
* @brief Calculate time difference
+6 -4
Ver Arquivo
@@ -21,10 +21,12 @@
#ifndef _CSYNC_VIO_LOCAL_H
#define _CSYNC_VIO_LOCAL_H
csync_vio_handle_t OCSYNC_EXPORT *csync_vio_local_opendir(const char *name);
int OCSYNC_EXPORT csync_vio_local_closedir(csync_vio_handle_t *dhandle);
csync_vio_file_stat_t OCSYNC_EXPORT *csync_vio_local_readdir(csync_vio_handle_t *dhandle);
#include <sys/time.h>
int OCSYNC_EXPORT csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf);
csync_vio_handle_t *csync_vio_local_opendir(const char *name);
int csync_vio_local_closedir(csync_vio_handle_t *dhandle);
csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle);
int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf);
#endif /* _CSYNC_VIO_LOCAL_H */
+1
Ver Arquivo
@@ -23,6 +23,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <stdio.h>
#include "windows.h"
+3 -18
Ver Arquivo
@@ -20,7 +20,6 @@
#include "config_csync.h"
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include "torture.h"
@@ -31,6 +30,7 @@
static void setup(void **state) {
CSYNC *csync;
int rc;
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
@@ -179,20 +179,6 @@ static void check_csync_excluded(void **state)
rc = csync_excluded_no_ctx(csync->excludes, "latex/songbook/my_manuscript.tex.tmp", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
#ifdef _WIN32
rc = csync_excluded_no_ctx(csync->excludes, "file_trailing_space ", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_TRAILING_SPACE);
rc = csync_excluded_no_ctx(csync->excludes, "file_trailing_dot.", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_INVALID_CHAR);
rc = csync_excluded_no_ctx(csync->excludes, "AUX", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_INVALID_CHAR);
rc = csync_excluded_no_ctx(csync->excludes, "file_invalid_char<", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_INVALID_CHAR);
#endif
}
static void check_csync_excluded_traversal(void **state)
@@ -319,14 +305,13 @@ static void check_csync_excluded_performance(void **state)
const int N = 10000;
int totalRc = 0;
int i = 0;
// Being able to use QElapsedTimer for measurement would be nice...
{
struct timeval before, after;
gettimeofday(&before, 0);
for (i = 0; i < N; ++i) {
for (int i = 0; i < N; ++i) {
totalRc += csync_excluded_no_ctx(csync->excludes, "/this/is/quite/a/long/path/with/many/components", CSYNC_FTW_TYPE_DIR);
totalRc += csync_excluded_no_ctx(csync->excludes, "/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/29", CSYNC_FTW_TYPE_FILE);
}
@@ -344,7 +329,7 @@ static void check_csync_excluded_performance(void **state)
struct timeval before, after;
gettimeofday(&before, 0);
for (i = 0; i < N; ++i) {
for (int i = 0; i < N; ++i) {
totalRc += csync_excluded_traversal(csync->excludes, "/this/is/quite/a/long/path/with/many/components", CSYNC_FTW_TYPE_DIR);
totalRc += csync_excluded_traversal(csync->excludes, "/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/29", CSYNC_FTW_TYPE_FILE);
}
+1
Ver Arquivo
@@ -74,6 +74,7 @@ static void teardown(void **state) {
static void check_csync_init(void **state)
{
CSYNC *csync = *state;
int rc;
csync_init(csync);
+1
Ver Arquivo
@@ -19,6 +19,7 @@
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "torture.h"
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <unistd.h>
#include "torture.h"
+1 -1
Ver Arquivo
@@ -520,7 +520,7 @@ sub put_to_dir( $$;$ )
$targetUrl = $optionsRef->{url};
}
}
$d->open($targetUrl . $dir);
$d->open($dir);
my $filename = $file;
$filename =~ s/^.*\///;
-7
Ver Arquivo
@@ -31,13 +31,6 @@ use strict;
print "Hello, this is t6, a tester for csync with ownCloud.\n";
# Checking CURL is installed to avoid misleading errors later...
system(("curl", "--help", ">", "/dev/null"));
if ($? != 0) {
print "CURL is needed for this script, aborting with error\n";
exit 1;
}
initTesting();
sub createPostUpdateScript($)
+1
Ver Arquivo
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <unistd.h>
#include "torture.h"
+1
Ver Arquivo
@@ -22,6 +22,7 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "torture.h"
+1
Ver Arquivo
@@ -22,6 +22,7 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include "torture.h"
+1 -1
Ver Arquivo
@@ -7,7 +7,7 @@ On Microsoft Windows systems:
``%LOCALAPPDATA%\ownCloud\owncloud.cfg``
On MAC OS X systems:
``$HOME/Library/Application Support/ownCloud/owncloud.cfg``
``$HOME/Library/Application Support/ownCloud``
The configuration file contains settings using the Microsoft Windows .ini file
+4 -12
Ver Arquivo
@@ -1,11 +1,3 @@
<!---
Please try to only report a bug if it happens with the latest version
The latest version can be seen by checking the ChangeLog: https://owncloud.org/changelog/desktop/
For support try: https://central.owncloud.org/c/help/desktop-file-sync
--->
### Expected behaviour
Tell us what should happen
@@ -28,7 +20,7 @@ PHP version:
ownCloud version:
Storage backend (external storage):
Storage backend:
### Client configuration
Client version:
@@ -46,11 +38,11 @@ logs.
```Template for output < 10 lines```
1. Client logfile: Output of `owncloud --logwindow` or `owncloud --logfile log.txt`
1. Output of `owncloud --logwindow` or `owncloud --logfile log.txt`
(On Windows using `cmd.exe`, you might need to first `cd` into the ownCloud directory)
(See also http://doc.owncloud.org/desktop/2.2/troubleshooting.html#client-logfile )
(See also http://doc.owncloud.org/desktop/1.8/troubleshooting.html#client-logfile )
2. Web server error log:
3. Server logfile: ownCloud log (data/owncloud.log):
3. ownCloud log (data/owncloud.log):
+106
Ver Arquivo
@@ -355,6 +355,111 @@ 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
Comment[oc]=@APPLICATION_NAME@ sincronizacion del client
GenericName[oc]=Dorsièr de Sincronizacion
@@ -490,6 +595,7 @@ Comment[th_TH]=@APPLICATION_NAME@ ไคลเอนต์ประสานข
GenericName[th_TH]=ประสานข้อมูลโฟลเดอร์
Name[th_TH]= @APPLICATION_NAME@ ไคลเอนต์ประสานข้อมูลเดสก์ท็อป
Icon[th_TH]=@APPLICATION_EXECUTABLE@
GenericName[es_MX]=Sincronización de Carpetas
Comment[nb_NO]=@APPLICATION_NAME@ skrivebordssynkroniseringsklient
GenericName[nb_NO]=Mappesynkronisering
Name[nb_NO]=@APPLICATION_NAME@ skrivebordssynkroniseringsklient
+2 -2
Ver Arquivo
@@ -19,8 +19,8 @@ if( UNIX AND NOT APPLE )
ERROR_VARIABLE errors OUTPUT_VARIABLE out)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syncstate.py DESTINATION ${DATADIR}/nautilus-python/extensions RENAME syncstate-${APPLICATION_SHORTNAME}.py)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syncstate_nemo.py DESTINATION ${DATADIR}/nemo-python/extensions RENAME syncstate-${APPLICATION_SHORTNAME}.py)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syncstate.py DESTINATION ${DATADIR}/nautilus-python/extensions)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syncstate_nemo.py DESTINATION ${DATADIR}/nemo-python/extensions RENAME syncstate.py)
+2 -33
Ver Arquivo
@@ -18,7 +18,6 @@
#include <QStringList>
#include <QUrl>
#include <QFile>
#include <QFileInfo>
#include <qdebug.h>
#include "account.h"
@@ -29,7 +28,6 @@
#include "syncengine.h"
#include "syncjournaldb.h"
#include "config.h"
#include "connectionvalidator.h"
#include "cmd.h"
@@ -42,14 +40,10 @@
#include <windows.h>
#else
#include <termios.h>
#include <unistd.h>
#endif
using namespace OCC;
static void nullMessageHandler(QtMsgType, const char *) {}
struct CmdOptions {
QString source_dir;
QString target_url;
@@ -73,8 +67,6 @@ struct CmdOptions {
// So we have to use a global variable
CmdOptions *opts = 0;
const qint64 timeoutToUseMsec = qMax(1000, ConnectionValidator::DefaultCallingIntervalMsec - 5*1000);
class EchoDisabler
{
public:
@@ -204,12 +196,10 @@ void parseOptions( const QStringList& app_args, CmdOptions *options )
if (!options->source_dir.endsWith('/')) {
options->source_dir.append('/');
}
QFileInfo fi(options->source_dir);
if( !fi.exists() ) {
if( !QFile::exists( options->source_dir )) {
std::cerr << "Source dir '" << qPrintable(options->source_dir) << "' does not exist." << std::endl;
exit(1);
}
options->source_dir = fi.absoluteFilePath();
QStringListIterator it(args);
// skip file name;
@@ -302,11 +292,6 @@ int main(int argc, char **argv) {
parseOptions( app.arguments(), &options );
csync_set_log_level(options.silent ? 1 : 11);
if (options.silent) {
qInstallMsgHandler(nullMessageHandler);
}
AccountPtr account = Account::create();
if( !account ) {
@@ -400,29 +385,13 @@ int main(int argc, char **argv) {
account->setCredentials(cred);
account->setSslErrorHandler(sslErrorHandler);
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
//obtain capabilities using event loop
QEventLoop loop;
JsonApiJob *job = new JsonApiJob(account, QLatin1String("ocs/v1.php/cloud/capabilities"));
job->setTimeout(timeoutToUseMsec);
QObject::connect(job, &JsonApiJob::jsonReceived, [&](const QVariantMap &json) {
auto caps = json.value("ocs").toMap().value("data").toMap().value("capabilities");
qDebug() << "Server capabilities" << caps;
account->setCapabilities(caps.toMap());
loop.quit();
});
job->start();
loop.exec();
#endif
// much lower age than the default since this utility is usually made to be run right after a change in the tests
SyncEngine::minimumFileAgeForUpload = 0;
int restartCount = 0;
restart_sync:
csync_set_log_level(options.silent ? 1 : 11);
opts = &options;
+7 -14
Ver Arquivo
@@ -70,9 +70,9 @@ set(client_SRCS
activityitemdelegate.cpp
selectivesyncdialog.cpp
settingsdialog.cpp
share.cpp
sharedialog.cpp
sharelinkwidget.cpp
sharemanager.cpp
shareusergroupwidget.cpp
sharee.cpp
socketapi.cpp
@@ -94,26 +94,22 @@ set(client_SRCS
servernotificationhandler.cpp
creds/credentialsfactory.cpp
creds/httpcredentialsgui.cpp
creds/shibbolethcredentials.cpp
creds/shibboleth/shibbolethwebview.cpp
creds/shibboleth/shibbolethuserjob.cpp
wizard/postfixlineedit.cpp
wizard/abstractcredswizardpage.cpp
wizard/owncloudadvancedsetuppage.cpp
wizard/owncloudconnectionmethoddialog.cpp
wizard/owncloudhttpcredspage.cpp
wizard/owncloudsetuppage.cpp
wizard/owncloudshibbolethcredspage.cpp
wizard/owncloudwizardcommon.cpp
wizard/owncloudwizard.cpp
wizard/owncloudwizardresultpage.cpp
../3rdparty/qjson/json.cpp
)
IF(NOT NO_SHIBBOLETH)
list(APPEND client_SRCS
creds/shibbolethcredentials.cpp
creds/shibboleth/shibbolethwebview.cpp
creds/shibboleth/shibbolethuserjob.cpp
wizard/owncloudshibbolethcredspage.cpp
)
endif()
set(updater_SRCS
updater/ocupdater.cpp
@@ -236,9 +232,6 @@ set(ownCloud ${ownCloud_old})
if (WITH_DBUS)
set(ADDITIONAL_APP_MODULES DBus)
endif(WITH_DBUS)
if (NOT NO_SHIBBOLETH)
list(APPEND ADDITIONAL_APP_MODULES WebKitWidgets)
endif()
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
@@ -257,14 +250,14 @@ if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
# add_executable( ${APPLICATION_EXECUTABLE} main.cpp ${final_src})
add_executable( ${APPLICATION_EXECUTABLE} WIN32 main.cpp ${final_src})
qt5_use_modules(${APPLICATION_EXECUTABLE} Widgets Network Xml Sql ${ADDITIONAL_APP_MODULES})
qt5_use_modules(${APPLICATION_EXECUTABLE} Widgets Network Xml WebKitWidgets Sql ${ADDITIONAL_APP_MODULES})
else()
# set(CMAKE_INSTALL_PREFIX ".") # Examples use /Applications. hurmpf.
set(MACOSX_BUNDLE_ICON_FILE "ownCloud.icns")
# we must add MACOSX_BUNDLE only if building a bundle
add_executable( ${APPLICATION_EXECUTABLE} WIN32 MACOSX_BUNDLE main.cpp ${final_src})
qt5_use_modules(${APPLICATION_EXECUTABLE} Widgets Network Xml Sql ${ADDITIONAL_APP_MODULES})
qt5_use_modules(${APPLICATION_EXECUTABLE} Widgets Network Xml WebKitWidgets Sql ${ADDITIONAL_APP_MODULES})
set (QM_DIR ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/Translations)
install(FILES ${client_I18N} DESTINATION ${QM_DIR})
+3 -8
Ver Arquivo
@@ -117,10 +117,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) :
connect(ui->selectiveSyncApply, SIGNAL(clicked()), _model, SLOT(slotApplySelectiveSync()));
connect(ui->selectiveSyncCancel, SIGNAL(clicked()), _model, SLOT(resetFolders()));
connect(ui->bigFolderApply, SIGNAL(clicked(bool)), _model, SLOT(slotApplySelectiveSync()));
connect(ui->bigFolderSyncAll, SIGNAL(clicked(bool)), _model, SLOT(slotSyncAllPendingBigFolders()));
connect(ui->bigFolderSyncNone, SIGNAL(clicked(bool)), _model, SLOT(slotSyncNoPendingBigFolders()));
connect(FolderMan::instance(), SIGNAL(folderListChanged(Folder::Map)), _model, SLOT(resetFolders()));
connect(this, SIGNAL(folderChanged()), _model, SLOT(resetFolders()));
@@ -639,13 +635,12 @@ void AccountSettings::refreshSelectiveSyncStatus()
}
if (msg.isEmpty()) {
ui->selectiveSyncButtons->setVisible(true);
ui->bigFolderUi->setVisible(false);
ui->selectiveSyncNotification->setVisible(false);
ui->selectiveSyncNotification->setText(QString());
} else {
ui->selectiveSyncNotification->setVisible(true);
QString wholeMsg = tr("There are new folders that were not synchronized because they are too big: ") + msg;
ui->selectiveSyncNotification->setText(wholeMsg);
ui->selectiveSyncButtons->setVisible(false);
ui->bigFolderUi->setVisible(true);
shouldBeVisible = true;
}
+33 -94
Ver Arquivo
@@ -154,105 +154,44 @@
</widget>
</item>
<item>
<widget class="QWidget" name="bigFolderUi" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="selectiveSyncNotification">
<property name="styleSheet">
<string notr="true">color: red</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="bigFolderSyncAll">
<property name="text">
<string>Synchronize all</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="bigFolderSyncNone">
<property name="text">
<string>Synchronize none</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="bigFolderApply">
<property name="text">
<string>Apply manual changes</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<widget class="QLabel" name="selectiveSyncNotification">
<property name="styleSheet">
<string notr="true">color: red</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="selectiveSyncButtons" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="selectiveSyncCancel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="selectiveSyncApply">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
<widget class="QPushButton" name="selectiveSyncCancel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="selectiveSyncApply">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
-16
Ver Arquivo
@@ -248,9 +248,6 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
QHash<QString, int> accNotified;
QString listAccountName;
// Whether a new notification widget was added to the notificationLayout.
bool newNotificationShown = false;
foreach( auto activity, list ) {
if( _blacklistedNotifications.contains(activity)) {
qDebug() << Q_FUNC_INFO << "Activity in blacklist, skip";
@@ -274,7 +271,6 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
_ui->_notifyScroll->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
#endif
_widgetForNotifId[activity.ident()] = widget;
newNotificationShown = true;
}
widget->setActivity( activity );
@@ -369,10 +365,6 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
const QString log = tr("%1 Notifications - Action Required").arg(Theme::instance()->appNameGUI());
emit guiLog( log, msg);
}
if (newNotificationShown) {
emit newNotification();
}
}
void ActivityWidget::slotSendNotificationRequest(const QString& accountName, const QString& link, const QByteArray& verb)
@@ -525,7 +517,6 @@ ActivitySettings::ActivitySettings(QWidget *parent)
connect(_activityWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard()));
connect(_activityWidget, SIGNAL(hideActivityTab(bool)), this, SLOT(setActivityTabHidden(bool)));
connect(_activityWidget, SIGNAL(guiLog(QString,QString)), this, SIGNAL(guiLog(QString,QString)));
connect(_activityWidget, SIGNAL(newNotification()), SLOT(slotShowActivityTab()));
_protocolWidget = new ProtocolWidget(this);
_tab->insertTab(1, _protocolWidget, Theme::instance()->syncStateIcon(SyncResult::Success), tr("Sync Protocol"));
@@ -591,13 +582,6 @@ void ActivitySettings::slotShowIssueItemCount(int cnt)
_tab->setTabText(_syncIssueTabId, cntText);
}
void ActivitySettings::slotShowActivityTab()
{
if (_activityTabId != -1) {
_tab->setCurrentIndex(_activityTabId);
}
}
void ActivitySettings::slotCopyToClipboard()
{
QString text;
+1 -2
Ver Arquivo
@@ -81,7 +81,7 @@ signals:
void copyToClipboard();
void rowsInserted();
void hideActivityTab(bool);
void newNotification();
void newNotificationList(const ActivityList& list);
private slots:
void slotBuildNotificationDisplay(const ActivityList& list);
@@ -143,7 +143,6 @@ private slots:
void setActivityTabHidden(bool hidden);
void slotRegularNotificationCheck();
void slotShowIssueItemCount(int cnt);
void slotShowActivityTab();
signals:
void guiLog(const QString&, const QString&);
+2 -3
Ver Arquivo
@@ -360,11 +360,10 @@ void Application::setupLogging()
Logger::instance()->enterNextLogFile();
qDebug() << QString::fromLatin1( "################## %1 %2 (%3) %4 on %5").arg(_theme->appName())
qDebug() << QString::fromLatin1( "################## %1 %2 (%3) %4").arg(_theme->appName())
.arg( QLocale::system().name() )
.arg(property("ui_lang").toString())
.arg(_theme->version())
.arg(Utility::platformName());
.arg(_theme->version());
// Setup CSYNC logging to forward to our own logger
csync_set_log_callback( csyncLogCatcher );
-4
Ver Arquivo
@@ -16,9 +16,7 @@
#include "creds/credentialsfactory.h"
#include "creds/httpcredentialsgui.h"
#include "creds/dummycredentials.h"
#ifndef NO_SHIBBOLETH
#include "creds/shibbolethcredentials.h"
#endif
namespace OCC
{
@@ -33,10 +31,8 @@ AbstractCredentials* create(const QString& type)
return new HttpCredentialsGui;
} else if (type == "dummy") {
return new DummyCredentials;
#ifndef NO_SHIBBOLETH
} else if (type == "shibboleth") {
return new ShibbolethCredentials;
#endif
} else {
qWarning("Unknown credentials type: %s", qPrintable(type));
return new DummyCredentials;
+12 -39
Ver Arquivo
@@ -14,7 +14,6 @@
*/
#include <QInputDialog>
#include <QLabel>
#include "creds/httpcredentialsgui.h"
#include "theme.h"
#include "account.h"
@@ -32,52 +31,26 @@ void HttpCredentialsGui::askFromUser()
void HttpCredentialsGui::askFromUserAsync()
{
QString msg = tr("Please enter %1 password:<br>"
"<br>"
"User: %2<br>"
"Account: %3<br>")
.arg(Utility::escape(Theme::instance()->appNameGUI()),
Utility::escape(_user),
Utility::escape(_account->displayName()));
QString reqTxt = requestAppPasswordText(_account);
if (!reqTxt.isEmpty()) {
msg += QLatin1String("<br>") + reqTxt + QLatin1String("<br>");
}
QString msg = tr("Please enter %1 password:\n"
"\n"
"User: %2\n"
"Account: %3\n")
.arg(Theme::instance()->appNameGUI(), _user, _account->displayName());
if (!_fetchErrorString.isEmpty()) {
msg += QLatin1String("<br>") + tr("Reading from keychain failed with error: '%1'").arg(
Utility::escape(_fetchErrorString)) + QLatin1String("<br>");
msg += QLatin1String("\n") + tr("Reading from keychain failed with error: '%1'").arg(
_fetchErrorString) + QLatin1String("\n");
}
QInputDialog dialog;
dialog.setWindowTitle(tr("Enter Password"));
dialog.setLabelText(msg);
dialog.setTextValue(_previousPassword);
dialog.setTextEchoMode(QLineEdit::Password);
if (QLabel *dialogLabel = dialog.findChild<QLabel *>()) {
dialogLabel->setOpenExternalLinks(true);
dialogLabel->setTextFormat(Qt::RichText);
}
bool ok = dialog.exec();
bool ok = false;
QString pwd = QInputDialog::getText(0, tr("Enter Password"), msg,
QLineEdit::Password, _previousPassword,
&ok);
if (ok) {
_password = dialog.textValue();
_password = pwd;
_ready = true;
persist();
}
emit asked();
}
QString HttpCredentialsGui::requestAppPasswordText(const Account* account)
{
if (account->serverVersionInt() < 0x090100) {
// Older server than 9.1 does not have trhe feature to request App Password
return QString();
}
return tr("<a href=\"%1\">Click here</a> to request an app password from the web interface.")
.arg(account->url().toString() + QLatin1String("/index.php/settings/personal?section=apppasswords"));
}
} // namespace OCC
-2
Ver Arquivo
@@ -30,8 +30,6 @@ public:
HttpCredentialsGui(const QString& user, const QString& password, const QString& certificatePath, const QString& certificatePasswd) : HttpCredentials(user, password, certificatePath, certificatePasswd) {}
void askFromUser() Q_DECL_OVERRIDE;
Q_INVOKABLE void askFromUserAsync();
static QString requestAppPasswordText(const Account *account);
};
} // namespace OCC
+21 -26
Ver Arquivo
@@ -62,7 +62,6 @@ Folder::Folder(const FolderDefinition& definition,
, _consecutiveFailingSyncs(0)
, _consecutiveFollowUpSyncs(0)
, _journal(definition.localPath)
, _fileLog(new SyncRunFileLog)
{
qRegisterMetaType<SyncFileItemVector>("SyncFileItemVector");
qRegisterMetaType<SyncFileItem::Direction>("SyncFileItem::Direction");
@@ -110,8 +109,6 @@ Folder::Folder(const FolderDefinition& definition,
this, SLOT(slotItemCompleted(const SyncFileItem &, const PropagatorJob &)));
connect(_engine.data(), SIGNAL(newBigFolder(QString)), this, SLOT(slotNewBigFolderDiscovered(QString)));
connect(_engine.data(), SIGNAL(seenLockedFile(QString)), FolderMan::instance(), SLOT(slotSyncOnceFileUnlocks(QString)));
connect(_engine.data(), SIGNAL(aboutToPropagate(SyncFileItemVector&)),
SLOT(slotLogPropagationStart()));
}
Folder::~Folder()
@@ -123,13 +120,6 @@ Folder::~Folder()
void Folder::checkLocalPath()
{
const QFileInfo fi(_definition.localPath);
_canonicalLocalPath = fi.canonicalFilePath();
if (_canonicalLocalPath.isEmpty()) {
qDebug() << "Broken symlink:" << _definition.localPath;
_canonicalLocalPath = _definition.localPath;
} else if( !_canonicalLocalPath.endsWith('/') ) {
_canonicalLocalPath.append('/');
}
if( fi.isDir() && fi.isReadable() ) {
qDebug() << "Checked local path ok";
@@ -168,7 +158,11 @@ QString Folder::alias() const
QString Folder::path() const
{
return _canonicalLocalPath;
QString p(_definition.localPath);
if( ! p.endsWith('/') ) {
p.append('/');
}
return p;
}
QString Folder::shortGuiLocalPath() const
@@ -201,7 +195,7 @@ void Folder::setIgnoreHiddenFiles(bool ignore)
QString Folder::cleanPath()
{
QString cleanedPath = QDir::cleanPath(_canonicalLocalPath);
QString cleanedPath = QDir::cleanPath(_definition.localPath);
if(cleanedPath.length() == 3 && cleanedPath.endsWith(":/"))
cleanedPath.remove(2,1);
@@ -370,11 +364,18 @@ void Folder::bubbleUpSyncResult()
SyncFileItemPtr firstConflictItem;
SyncFileItemPtr firstItemError;
SyncRunFileLog syncFileLog;
syncFileLog.start(path(), _engine->isSyncRunning() ? _engine->stopWatch() : Utility::StopWatch() );
QElapsedTimer timer;
timer.start();
foreach (const SyncFileItemPtr &item, _syncResult.syncFileItemVector() ) {
// Process the item to the gui
// Log the item
syncFileLog.logItem( *item );
// and process the item to the gui
if( item->_status == SyncFileItem::FatalError || item->_status == SyncFileItem::NormalError ) {
//: this displays an error string (%2) for a file %1
slotSyncError( tr("%1: %2").arg(item->_file, item->_errorString) );
@@ -413,9 +414,11 @@ void Folder::bubbleUpSyncResult()
firstItemDeleted = item;
break;
case CSYNC_INSTRUCTION_SYNC:
updatedItems++;
if (!firstItemUpdated)
firstItemUpdated = item;
if (!item->_isDirectory) {
updatedItems++;
if (!firstItemUpdated)
firstItemUpdated = item;
}
break;
case CSYNC_INSTRUCTION_ERROR:
qDebug() << "Got Instruction ERROR. " << _syncResult.errorString();
@@ -437,6 +440,7 @@ void Folder::bubbleUpSyncResult()
}
}
}
syncFileLog.close();
qDebug() << "Processing result list and logging took " << timer.elapsed() << " Milliseconds.";
_syncResult.setWarnCount(ignoredItems);
@@ -754,8 +758,6 @@ void Folder::startSync(const QStringList &pathList)
_engine->setIgnoreHiddenFiles(_definition.ignoreHiddenFiles);
_fileLog->start(path());
QMetaObject::invokeMethod(_engine.data(), "startSync", Qt::QueuedConnection);
// disable events until syncing is done
@@ -819,7 +821,6 @@ void Folder::slotSyncFinished(bool success)
} else {
qDebug() << "-> SyncEngine finished without problem.";
}
_fileLog->finish();
bubbleUpSyncResult();
bool anotherSyncNeeded = _engine->isAnotherSyncNeeded();
@@ -926,7 +927,6 @@ void Folder::slotItemCompleted(const SyncFileItem &item, const PropagatorJob& jo
// Count all error conditions.
_syncResult.setWarnCount(_syncResult.warnCount()+1);
}
_fileLog->logItem(item);
emit ProgressDispatcher::instance()->itemCompleted(alias(), item, job);
}
@@ -964,11 +964,6 @@ void Folder::slotNewBigFolderDiscovered(const QString &newF)
}
}
void Folder::slotLogPropagationStart()
{
_fileLog->logLap("Propagation starts");
}
void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel)
@@ -1003,7 +998,7 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel)
void Folder::slotAboutToRestoreBackup(bool *restore)
{
QString msg =
tr("This sync would reset the files to an earlier time in the sync folder '%1'.\n"
tr("This sync would reset the files to an erlier time in the sync folder '%1'.\n"
"This might be because a backup was restored on the server.\n"
"Continuing the sync as normal will cause all your files to be overwritten by an older "
"file in an earlier state. "
-6
Ver Arquivo
@@ -35,7 +35,6 @@ namespace OCC {
class SyncEngine;
class AccountState;
class SyncRunFileLog;
/**
* @brief The FolderDefinition class
@@ -264,8 +263,6 @@ private slots:
void slotNewBigFolderDiscovered(const QString &);
void slotLogPropagationStart();
private:
bool setIgnoredFiles();
@@ -288,7 +285,6 @@ private:
AccountStatePtr _accountState;
FolderDefinition _definition;
QString _canonicalLocalPath; // As returned with QFileInfo:canonicalFilePath. Always ends with "/"
SyncResult _syncResult;
QScopedPointer<SyncEngine> _engine;
@@ -315,8 +311,6 @@ private:
SyncJournalDb _journal;
ClientProxy _clientProxy;
QScopedPointer<SyncRunFileLog> _fileLog;
};
}
+8 -91
Ver Arquivo
@@ -590,7 +590,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
QStringList sortedSubfolders = list;
// skip the parent item (first in the list)
sortedSubfolders.erase(sortedSubfolders.begin());
Utility::sortFilenames(sortedSubfolders);
sortedSubfolders.sort();
QVarLengthArray<int, 10> undecidedIndexes;
@@ -943,20 +943,11 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress)
if (totalSize > 0) {
QString s1 = Utility::octetsToString( completedSize );
QString s2 = Utility::octetsToString( totalSize );
if (progress.trustEta()) {
//: Example text: "5 minutes left, 12 MB of 345 MB, file 6 of 7"
overallSyncString = tr("%5 left, %1 of %2, file %3 of %4")
.arg(s1, s2)
.arg(currentFile).arg(totalFileCount)
.arg( Utility::durationToDescriptiveString1(progress.totalProgress().estimatedEta) );
} else {
//: Example text: "12 MB of 345 MB, file 6 of 7"
overallSyncString = tr("%1 of %2, file %3 of %4")
.arg(s1, s2)
.arg(currentFile).arg(totalFileCount);
}
//: Example text: "5 minutes left, 12 MB of 345 MB, file 6 of 7"
overallSyncString = tr("%5 left, %1 of %2, file %3 of %4")
.arg(s1, s2)
.arg(currentFile).arg(totalFileCount)
.arg( Utility::durationToDescriptiveString1(progress.totalProgress().estimatedEta) );
} else if (totalFileCount > 0) {
// Don't attempt to estimate the time left if there is no kb to transfer.
overallSyncString = tr("file %1 of %2") .arg(currentFile).arg(totalFileCount);
@@ -1046,77 +1037,6 @@ void FolderStatusModel::resetFolders()
setAccountState(_accountState);
}
void FolderStatusModel::slotSyncAllPendingBigFolders()
{
for (int i = 0; i < _folders.count(); ++i) {
if (!_folders[i]._fetched) {
_folders[i]._folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList());
continue;
}
auto folder = _folders.at(i)._folder;
bool ok;
auto undecidedList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, &ok);
if( !ok ) {
qDebug() << Q_FUNC_INFO << "Could not read selective sync list from db.";
return;
}
// If this folder had no undecided entries, skip it.
if (undecidedList.isEmpty()) {
continue;
}
// Remove all undecided folders from the blacklist
auto blackList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
if( !ok ) {
qDebug() << Q_FUNC_INFO << "Could not read selective sync list from db.";
return;
}
foreach (const auto& undecidedFolder, undecidedList) {
blackList.removeAll(undecidedFolder);
}
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
// Add all undecided folders to the white list
auto whiteList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok);
if( !ok ) {
qDebug() << Q_FUNC_INFO << "Could not read selective sync list from db.";
return;
}
whiteList += undecidedList;
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, whiteList);
// Clear the undecided list
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList());
// Trigger a sync
if (folder->isBusy()) {
folder->slotTerminateSync();
}
// The part that changed should not be read from the DB on next sync because there might be new folders
// (the ones that are no longer in the blacklist)
foreach (const auto &it, undecidedList) {
folder->journalDb()->avoidReadFromDbOnNextSync(it);
}
FolderMan::instance()->slotScheduleSync(folder);
}
resetFolders();
}
void FolderStatusModel::slotSyncNoPendingBigFolders()
{
for (int i = 0; i < _folders.count(); ++i) {
auto folder = _folders.at(i)._folder;
// clear the undecided list
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList());
}
resetFolders();
}
void FolderStatusModel::slotNewBigFolder()
{
auto f = qobject_cast<Folder *>(sender());
@@ -1147,14 +1067,11 @@ void FolderStatusModel::slotShowFetchProgress()
auto idx = it.key();
auto* info = infoForIndex(idx);
if (info && info->_fetching) {
bool add = !info->hasLabel();
if (add) {
if (!info->hasLabel()) {
beginInsertRows(idx, 0, 0);
}
info->_fetchingLabel = true;
if (add) {
endInsertRows();
}
info->_fetchingLabel = true;
}
it.remove();
}
-2
Ver Arquivo
@@ -107,8 +107,6 @@ public slots:
void slotUpdateFolderState(Folder *);
void slotApplySelectiveSync();
void resetFolders();
void slotSyncAllPendingBigFolders();
void slotSyncNoPendingBigFolders();
void slotSetProgress(const ProgressInfo &progress);
private slots:
+1 -1
Ver Arquivo
@@ -308,7 +308,7 @@ void FolderWizardRemotePath::slotUpdateDirectories(const QStringList &list)
root->setData(0, Qt::UserRole, "/");
}
QStringList sortedList = list;
Utility::sortFilenames(sortedList);
sortedList.sort();
foreach (QString path, sortedList) {
path.remove(webdavFolder);
QStringList paths = path.split('/');
-3
Ver Arquivo
@@ -15,7 +15,6 @@
#include "filesystem.h"
#include <QTimer>
#include <QDebug>
using namespace OCC;
@@ -31,7 +30,6 @@ LockWatcher::LockWatcher(QObject* parent)
void LockWatcher::addFile(const QString& path)
{
qDebug() << "Watching for lock of" << path << "being released";
_watchedPaths.insert(path);
}
@@ -41,7 +39,6 @@ void LockWatcher::checkFiles()
foreach (const QString& path, _watchedPaths) {
if (!FileSystem::isFileLocked(path)) {
qDebug() << "Lock of" << path << "was released";
emit fileUnlocked(path);
unlocked.insert(path);
}
+1 -1
Ver Arquivo
@@ -15,7 +15,7 @@
#define OCSSHAREJOB_H
#include "ocsjob.h"
#include "sharemanager.h"
#include "share.h"
#include <QVector>
#include <QList>
#include <QPair>
+55 -189
Ver Arquivo
@@ -56,7 +56,6 @@ ownCloudGui::ownCloudGui(Application *parent) :
_settingsDialog(new SettingsDialog(this)),
#endif
_logBrowser(0),
_contextMenuVisibleOsx(false),
_recentActionsMenu(0),
_qdbusmenuWorkaround(false),
_folderOpenActionMapper(new QSignalMapper(this)),
@@ -93,9 +92,9 @@ ownCloudGui::ownCloudGui(Application *parent) :
this,SLOT(slotSyncStateChange(Folder*)));
connect( AccountManager::instance(), SIGNAL(accountAdded(AccountState*)),
SLOT(updateContextMenuNeeded()));
SLOT(setupContextMenu()));
connect( AccountManager::instance(), SIGNAL(accountRemoved(AccountState*)),
SLOT(updateContextMenuNeeded()));
SLOT(setupContextMenu()));
connect( Logger::instance(), SIGNAL(guiLog(QString,QString)),
SLOT(slotShowTrayMessage(QString,QString)));
@@ -194,7 +193,7 @@ void ownCloudGui::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
void ownCloudGui::slotSyncStateChange( Folder* folder )
{
slotComputeOverallSyncStatus();
updateContextMenuNeeded();
setupContextMenu();
if( !folder ) {
return; // Valid, just a general GUI redraw was needed.
@@ -216,7 +215,7 @@ void ownCloudGui::slotSyncStateChange( Folder* folder )
void ownCloudGui::slotFoldersChanged()
{
slotComputeOverallSyncStatus();
updateContextMenuNeeded();
setupContextMenu();
}
void ownCloudGui::slotOpenPath(const QString &path)
@@ -226,7 +225,7 @@ void ownCloudGui::slotOpenPath(const QString &path)
void ownCloudGui::slotAccountStateChanged()
{
updateContextMenuNeeded();
setupContextMenu();
slotComputeOverallSyncStatus();
}
@@ -400,154 +399,26 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
}
void ownCloudGui::slotContextMenuAboutToShow()
{
// For some reason on OS X _contextMenu->isVisible returns always false
qDebug() << "";
_contextMenuVisibleOsx = true;
}
void ownCloudGui::slotContextMenuAboutToHide()
{
// For some reason on OS X _contextMenu->isVisible returns always false
qDebug() << "";
_contextMenuVisibleOsx = false;
}
bool ownCloudGui::contextMenuVisible() const
{
#ifdef Q_OS_MAC
return _contextMenuVisibleOsx;
#else
return _contextMenu->isVisible();
#endif
}
static bool minimalTrayMenu()
{
static QByteArray var = qgetenv("OWNCLOUD_MINIMAL_TRAY_MENU");
return !var.isEmpty();
}
static bool updateWhileVisible()
{
static QByteArray var = qgetenv("OWNCLOUD_TRAY_UPDATE_WHILE_VISIBLE");
if (var == "1") {
return true;
} else if (var == "0") {
return false;
} else {
// triggers bug on OS X: https://bugreports.qt.io/browse/QTBUG-54845
// or flickering on Xubuntu
return false;
}
}
static QByteArray forceQDBusTrayWorkaround()
{
static QByteArray var = qgetenv("OWNCLOUD_FORCE_QDBUS_TRAY_WORKAROUND");
return var;
}
void ownCloudGui::setupContextMenu()
{
if (_contextMenu) {
return;
}
_contextMenu.reset(new QMenu());
_contextMenu->setTitle(Theme::instance()->appNameGUI() );
_recentActionsMenu = new QMenu(tr("Recent Changes"), _contextMenu.data());
// this must be called only once after creating the context menu, or
// it will trigger a bug in Ubuntu's SNI bridge patch (11.10, 12.04).
_tray->setContextMenu(_contextMenu.data());
// The tray menu is surprisingly problematic. Being able to switch to
// a minimal version of it is a useful workaround and testing tool.
if (minimalTrayMenu()) {
_contextMenu->addAction(_actionQuit);
if (!_contextMenu) {
_contextMenu.reset(new QMenu());
_recentActionsMenu = new QMenu(tr("Recent Changes"), _contextMenu.data());
_tray->setContextMenu(_contextMenu.data());
_contextMenu->addAction(_actionQuit);
}
return;
}
// Enables workarounds for bugs introduced in Qt 5.5.0
// In particular QTBUG-47863 #3672 (tray menu fails to update and
// becomes unresponsive) and QTBUG-48068 #3722 (click signal is
// emitted several times)
// The Qt version check intentionally uses 5.0.0 (where platformMenu()
// was introduced) instead of 5.5.0 to avoid issues where the Qt
// version used to build is different from the one used at runtime.
// If we build with 5.6.1 or newer, we can skip this because the
// bugs should be fixed there.
#ifdef Q_OS_LINUX
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
if (qVersion() == QByteArray("5.5.0")) {
QObject* platformMenu = reinterpret_cast<QObject*>(_tray->contextMenu()->platformMenu());
if (platformMenu
&& platformMenu->metaObject()->className() == QLatin1String("QDBusPlatformMenu")) {
_qdbusmenuWorkaround = true;
qDebug() << "Enabled QDBusPlatformMenu workaround";
}
}
#endif
#endif
if (forceQDBusTrayWorkaround() == "1") {
_qdbusmenuWorkaround = true;
} else if (forceQDBusTrayWorkaround() == "0") {
_qdbusmenuWorkaround = false;
}
// When the qdbusmenuWorkaround is necessary, we can't do on-demand updates
// because the workaround is to hide and show the tray icon.
if (_qdbusmenuWorkaround) {
connect(&_workaroundBatchTrayUpdate, SIGNAL(timeout()), SLOT(updateContextMenu()));
_workaroundBatchTrayUpdate.setInterval(30 * 1000);
_workaroundBatchTrayUpdate.setSingleShot(true);
} else {
// Update the context menu whenever we're about to show it
// to the user.
#ifdef Q_OS_MAC
// https://bugreports.qt.io/browse/QTBUG-54633
connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(slotContextMenuAboutToShow()));
connect(_contextMenu.data(), SIGNAL(aboutToHide()), SLOT(slotContextMenuAboutToHide()));
#else
connect(_contextMenu.data(), SIGNAL(aboutToShow()), SLOT(updateContextMenu()));
#endif
}
// Populate the context menu now.
updateContextMenu();
}
void ownCloudGui::updateContextMenu()
{
if (minimalTrayMenu()) {
return;
}
if (_qdbusmenuWorkaround) {
// To make tray menu updates work with these bugs (see setupContextMenu)
// we need to hide and show the tray icon. We don't want to do that
// while it's visible!
if (contextMenuVisible()) {
if (!_workaroundBatchTrayUpdate.isActive()) {
_workaroundBatchTrayUpdate.start();
}
return;
}
_tray->hide();
}
_contextMenu->clear();
slotRebuildRecentMenus();
// We must call deleteLater because we might be called from the press in one of the actions.
foreach (auto menu, _accountMenus) { menu->deleteLater(); }
_accountMenus.clear();
auto accountList = AccountManager::instance()->accounts();
bool isConfigured = (!accountList.isEmpty());
@@ -574,6 +445,41 @@ void ownCloudGui::updateContextMenu()
}
}
if ( _contextMenu ) {
if (_qdbusmenuWorkaround) {
_tray->hide();
}
_contextMenu->clear();
slotRebuildRecentMenus();
} else {
_contextMenu.reset(new QMenu());
_recentActionsMenu = new QMenu(tr("Recent Changes"), _contextMenu.data());
// this must be called only once after creating the context menu, or
// it will trigger a bug in Ubuntu's SNI bridge patch (11.10, 12.04).
_tray->setContextMenu(_contextMenu.data());
// Enables workarounds for bugs introduced in Qt 5.5.0
// In particular QTBUG-47863 #3672 (tray menu fails to update and
// becomes unresponsive) and QTBUG-48068 #3722 (click signal is
// emitted several times)
// The Qt version check intentionally uses 5.0.0 (where platformMenu()
// was introduced) instead of 5.5.0 to avoid issues where the Qt
// version used to build is different from the one used at runtime.
#ifdef Q_OS_LINUX
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QObject* platformMenu = reinterpret_cast<QObject*>(_tray->contextMenu()->platformMenu());
if (platformMenu
&& platformMenu->metaObject()->className() == QLatin1String("QDBusPlatformMenu")) {
_qdbusmenuWorkaround = true;
qDebug() << "Enabled QDBusPlatformMenu workaround";
}
#endif
#endif
}
_contextMenu->setTitle(Theme::instance()->appNameGUI() );
// We must call deleteLater because we might be called from the press in one of the actions.
foreach (auto menu, _accountMenus) { menu->deleteLater(); }
_accountMenus.clear();
if (accountList.count() > 1) {
foreach (AccountStatePtr account, accountList) {
QMenu* accountMenu = new QMenu(account->account()->displayName(), _contextMenu.data());
@@ -646,31 +552,6 @@ void ownCloudGui::updateContextMenu()
}
}
void ownCloudGui::updateContextMenuNeeded()
{
// For the workaround case updating while visible is impossible. Instead
// occasionally update the menu when it's invisible.
if (_qdbusmenuWorkaround) {
if (!_workaroundBatchTrayUpdate.isActive()) {
_workaroundBatchTrayUpdate.start();
}
return;
}
#ifdef Q_OS_MAC
// https://bugreports.qt.io/browse/QTBUG-54845
// We cannot update on demand or while visible -> update when invisible.
if (!contextMenuVisible()) {
updateContextMenu();
}
#else
if (updateWhileVisible() && contextMenuVisible())
updateContextMenu();
#endif
// If no update was done here, we might update it on-demand due to
// the aboutToShow() signal.
}
void ownCloudGui::slotShowTrayMessage(const QString &title, const QString &msg)
{
@@ -777,29 +658,18 @@ void ownCloudGui::slotUpdateProgress(const QString &folder, const ProgressInfo&
} else if (progress.totalSize() == 0 ) {
quint64 currentFile = progress.currentFile();
quint64 totalFileCount = qMax(progress.totalFiles(), currentFile);
QString msg;
if (progress.trustEta()) {
msg = tr("Syncing %1 of %2 (%3 left)")
.arg( currentFile ).arg( totalFileCount )
.arg( Utility::durationToDescriptiveString2(progress.totalProgress().estimatedEta) );
} else {
msg = tr("Syncing %1 of %2")
.arg( currentFile ).arg( totalFileCount );
}
_actionStatus->setText( msg );
_actionStatus->setText( tr("Syncing %1 of %2 (%3 left)")
.arg( currentFile ).arg( totalFileCount )
.arg( Utility::durationToDescriptiveString2(progress.totalProgress().estimatedEta) ) );
} else {
QString totalSizeStr = Utility::octetsToString( progress.totalSize() );
QString msg;
if (progress.trustEta()) {
msg = tr("Syncing %1 (%2 left)")
.arg( totalSizeStr, Utility::durationToDescriptiveString2(progress.totalProgress().estimatedEta) );
} else {
msg = tr("Syncing %1")
.arg( totalSizeStr );
}
_actionStatus->setText( msg );
_actionStatus->setText( tr("Syncing %1 (%2 left)")
.arg( totalSizeStr, Utility::durationToDescriptiveString2(progress.totalProgress().estimatedEta) ) );
}
_actionRecent->setIcon( QIcon() ); // Fixme: Set a "in-progress"-item eventually.
if (!progress._lastCompletedItem.isEmpty()
@@ -830,11 +700,7 @@ void ownCloudGui::slotUpdateProgress(const QString &folder, const ProgressInfo&
}
_recentItemsActions.append(action);
// Update the "Recent" menu if the context menu is being shown,
// otherwise it'll be updated later, when the context menu is opened.
if (updateWhileVisible() && contextMenuVisible()) {
slotRebuildRecentMenus();
}
slotRebuildRecentMenus();
}
if (progress.isUpdatingEstimates()
-14
Ver Arquivo
@@ -24,7 +24,6 @@
#include <QMenu>
#include <QSignalMapper>
#include <QSize>
#include <QTimer>
namespace OCC {
@@ -53,18 +52,11 @@ public:
static QSize settingsDialogSize() { return QSize(800, 500); }
void setupOverlayIcons();
/// Whether the tray menu is visible
bool contextMenuVisible() const;
signals:
void setupProxy();
public slots:
void setupContextMenu();
void updateContextMenu();
void updateContextMenuNeeded();
void slotContextMenuAboutToShow();
void slotContextMenuAboutToHide();
void slotComputeOverallSyncStatus();
void slotShowTrayMessage(const QString &title, const QString &msg);
void slotShowOptionalTrayMessage(const QString &title, const QString &msg);
@@ -109,15 +101,9 @@ private:
QPointer<LogBrowser>_logBrowser;
// tray's menu
QScopedPointer<QMenu> _contextMenu;
// Manually tracking whether the context menu is visible, but only works
// on OSX because aboutToHide is not reliable everywhere.
bool _contextMenuVisibleOsx;
QMenu *_recentActionsMenu;
QVector<QMenu*> _accountMenus;
bool _qdbusmenuWorkaround;
QTimer _workaroundBatchTrayUpdate;
QMap<QString, QPointer<ShareDialog> > _shareDialogs;
QAction *_actionLogin;
+4 -47
Ver Arquivo
@@ -30,7 +30,6 @@
#include "networkjobs.h"
#include "sslerrordialog.h"
#include "accountmanager.h"
#include "clientproxy.h"
#include "creds/credentialsfactory.h"
#include "creds/abstractcredentials.h"
@@ -129,38 +128,7 @@ void OwncloudSetupWizard::slotDetermineAuthType(const QString &urlString)
account->setUrl(url);
// Reset the proxy which might had been determined previously in ConnectionValidator::checkServerAndAuth()
// when there was a previous account.
account->networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::NoProxy));
// Lookup system proxy in a thread https://github.com/owncloud/client/issues/2993
if (ClientProxy::isUsingSystemDefault()) {
qDebug() << "Trying to look up system proxy";
ClientProxy::lookupSystemProxyAsync(account->url(),
this, SLOT(slotSystemProxyLookupDone(QNetworkProxy)));
} else {
// We want to reset the QNAM proxy so that the global proxy settings are used (via ClientProxy settings)
account->networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::DefaultProxy));
// use a queued invocation so we're as asynchronous as with the other code path
QMetaObject::invokeMethod(this, "slotContinueDetermineAuth", Qt::QueuedConnection);
}
}
void OwncloudSetupWizard::slotSystemProxyLookupDone(const QNetworkProxy &proxy)
{
if (proxy.type() != QNetworkProxy::NoProxy) {
qDebug() << "Setting QNAM proxy to be system proxy" << printQNetworkProxy(proxy);
} else {
qDebug() << "No system proxy set by OS";
}
AccountPtr account = _ocWizard->account();
account->networkAccessManager()->setProxy(proxy);
slotContinueDetermineAuth();
}
void OwncloudSetupWizard::slotContinueDetermineAuth()
{
AccountPtr account = _ocWizard->account();
account->networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::DefaultProxy));
// Set fake credentials before we check what credential it actually is.
account->setCredentials(CredentialsFactory::create("dummy"));
CheckServerJob *job = new CheckServerJob(_ocWizard->account(), this);
@@ -168,21 +136,17 @@ void OwncloudSetupWizard::slotContinueDetermineAuth()
connect(job, SIGNAL(instanceFound(QUrl,QVariantMap)), SLOT(slotOwnCloudFoundAuth(QUrl,QVariantMap)));
connect(job, SIGNAL(instanceNotFound(QNetworkReply*)), SLOT(slotNoOwnCloudFoundAuth(QNetworkReply*)));
connect(job, SIGNAL(timeout(const QUrl&)), SLOT(slotNoOwnCloudFoundAuthTimeout(const QUrl&)));
job->setTimeout((account->url().scheme() == "https") ? 30*1000 : 10*1000);
job->setTimeout(10*1000);
job->start();
}
void OwncloudSetupWizard::slotOwnCloudFoundAuth(const QUrl& url, const QVariantMap &info)
{
auto serverVersion = CheckServerJob::version(info);
_ocWizard->appendToConfigurationLog(tr("<font color=\"green\">Successfully connected to %1: %2 version %3 (%4)</font><br/><br/>")
.arg(url.toString())
.arg(Theme::instance()->appNameGUI())
.arg(CheckServerJob::versionString(info))
.arg(serverVersion));
_ocWizard->account()->setServerVersion(serverVersion);
.arg(CheckServerJob::version(info)));
QString p = url.path();
if (p.endsWith("/status.php")) {
@@ -540,10 +504,6 @@ DetermineAuthTypeJob::DetermineAuthTypeJob(AccountPtr account, QObject *parent)
: AbstractNetworkJob(account, QString(), parent)
, _redirects(0)
{
// This job implements special redirect handling to detect redirections
// to pages that are indicative of Shibboleth-using servers. Hence we
// disable the standard job redirection handling here.
_followRedirects = false;
}
void DetermineAuthTypeJob::start()
@@ -571,15 +531,12 @@ bool DetermineAuthTypeJob::finished()
setupConnections(reply());
return false; // don't discard
} else {
#ifndef NO_SHIBBOLETH
QRegExp shibbolethyWords("SAML|wayf");
shibbolethyWords.setCaseSensitivity(Qt::CaseInsensitive);
if (redirection.toString().contains(shibbolethyWords)) {
emit authType(WizardCommon::Shibboleth);
} else
#endif
{
} else {
// TODO: Send an error.
// eh?
emit authType(WizardCommon::HttpCreds);
+1 -2
Ver Arquivo
@@ -66,8 +66,6 @@ signals:
private slots:
void slotDetermineAuthType(const QString&);
void slotSystemProxyLookupDone(const QNetworkProxy &proxy);
void slotContinueDetermineAuth();
void slotOwnCloudFoundAuth(const QUrl&, const QVariantMap&);
void slotNoOwnCloudFoundAuth(QNetworkReply *reply);
void slotNoOwnCloudFoundAuthTimeout(const QUrl&url);
@@ -95,6 +93,7 @@ private:
OwncloudWizard* _ocWizard;
QString _initLocalFolder;
QString _remoteFolder;
};
}
+1 -1
Ver Arquivo
@@ -222,7 +222,7 @@ void SelectiveSyncTreeView::slotUpdateDirectories(QStringList list)
}
}
Utility::sortFilenames(list);
list.sort();
foreach (QString path, list) {
auto size = job ? job->_sizes.value(path) : 0;
path.remove(pathToRemove);
+8 -8
Ver Arquivo
@@ -11,7 +11,7 @@
* for more details.
*/
#include "sharemanager.h"
#include "share.h"
#include "ocssharejob.h"
#include "account.h"
@@ -30,9 +30,9 @@ Q_DECLARE_METATYPE(CreateShare)
namespace OCC {
Share::Share(AccountPtr account,
const QString& id,
const QString& path,
Share::Share(AccountPtr account,
const QString& id,
const QString& path,
const ShareType shareType,
const Permissions permissions,
const QSharedPointer<Sharee> shareWith)
@@ -100,7 +100,7 @@ void Share::slotDeleted()
void Share::slotOcsError(int statusCode, const QString &message)
{
emit serverError(statusCode, message);
emit serverError(statusCode, message);
}
QUrl LinkShare::getLink() const
@@ -229,7 +229,7 @@ void ShareManager::slotLinkShareCreated(const QVariantMap &reply)
if (code == 403) {
emit linkShareRequiresPassword(message);
return;
}
}
//Parse share
auto data = reply.value("ocs").toMap().value("data").toMap();
@@ -329,7 +329,7 @@ void ShareManager::slotSharesFetched(const QVariantMap &reply)
newShare = parseShare(data);
}
shares.append(QSharedPointer<Share>(newShare));
shares.append(QSharedPointer<Share>(newShare));
}
qDebug() << Q_FUNC_INFO << "Sending " << shares.count() << "shares";
@@ -371,7 +371,7 @@ QSharedPointer<Share> ShareManager::parseShare(const QVariantMap &data)
QSharedPointer<Sharee> sharee(new Sharee(data.value("share_with").toString(),
data.value("share_with_displayname").toString(),
(Sharee::Type)data.value("share_type").toInt()));
return QSharedPointer<Share>(new Share(_account,
data.value("id").toString(),
data.value("path").toString(),
+6 -5
Ver Arquivo
@@ -11,8 +11,8 @@
* for more details.
*/
#ifndef SHAREMANAGER_H
#define SHAREMANAGER_H
#ifndef SHARE_H
#define SHARE_H
#include "accountfwd.h"
#include "sharee.h"
@@ -127,7 +127,7 @@ private slots:
class LinkShare : public Share {
Q_OBJECT
public:
explicit LinkShare(AccountPtr account,
const QString& id,
const QString& path,
@@ -154,7 +154,7 @@ public:
* In case of a server error the serverError signal is emitted.
*/
void setPublicUpload(bool publicUpload);
/*
* Set the password
*
@@ -276,6 +276,7 @@ private:
AccountPtr _account;
};
}
#endif // SHAREMANAGER_H
#endif // SHARE_H
-1
Ver Arquivo
@@ -46,7 +46,6 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
_userGroupWidget(NULL),
_progressIndicator(NULL)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setAttribute(Qt::WA_DeleteOnClose);
setObjectName("SharingDialog"); // required as group for saveGeometry call
+1 -33
Ver Arquivo
@@ -17,14 +17,12 @@
#include "account.h"
#include "capabilities.h"
#include "sharemanager.h"
#include "share.h"
#include "QProgressIndicator.h"
#include <QBuffer>
#include <QClipboard>
#include <QFileInfo>
#include <QDesktopServices>
#include <QMessageBox>
namespace OCC {
@@ -55,10 +53,6 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
_ui->pushButton_copy->setEnabled(false);
connect(_ui->pushButton_copy, SIGNAL(clicked(bool)), SLOT(slotPushButtonCopyLinkPressed()));
_ui->pushButton_mail->setIcon(QIcon::fromTheme("mail-send"));
_ui->pushButton_mail->setEnabled(false);
connect(_ui->pushButton_mail, SIGNAL(clicked(bool)), SLOT(slotPushButtonMailLinkPressed()));
// the following progress indicator widgets are added to layouts which makes them
// automatically deleted once the dialog dies.
_pi_link = new QProgressIndicator();
@@ -230,7 +224,6 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
if (share->getShareType() == Share::TypeLink) {
_share = qSharedPointerDynamicCast<LinkShare>(share);
_ui->pushButton_copy->show();
_ui->pushButton_mail->show();
_ui->widget_shareLink->show();
_ui->checkBox_shareLink->setChecked(true);
@@ -275,7 +268,6 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
}
setShareLink(_share->getLink().toString());
_ui->pushButton_mail->setEnabled(true);
_ui->pushButton_copy->setEnabled(true);
// Connect all shares signals to gui slots
@@ -332,7 +324,6 @@ void ShareLinkWidget::setShareLink( const QString& url )
if( realUrl.isValid() ) {
_shareUrl = url;
_ui->pushButton_copy->setEnabled(true);
_ui->pushButton_mail->setEnabled(true);
} else {
_shareUrl.clear();
_ui->_labelShareLink->setText(QString::null);
@@ -348,7 +339,6 @@ void ShareLinkWidget::slotDeleteShareFetched()
_ui->lineEdit_password->clear();
_ui->_labelShareLink->clear();
_ui->pushButton_copy->setEnabled(false);
_ui->pushButton_mail->setEnabled(false);
_ui->widget_shareLink->hide();
_ui->lineEdit_password->hide();
_ui->pushButton_setPassword->setEnabled(false);
@@ -379,7 +369,6 @@ void ShareLinkWidget::slotCheckBoxShareLinkClicked()
_ui->lineEdit_password->setEnabled(true);
_ui->lineEdit_password->setFocus();
_ui->pushButton_copy->hide();
_ui->pushButton_mail->hide();
_ui->widget_shareLink->show();
slotCheckBoxPasswordClicked();
@@ -425,7 +414,6 @@ void ShareLinkWidget::slotCreateShareRequiresPassword(const QString& message)
_ui->lineEdit_password->setEnabled(true);
_ui->lineEdit_password->setFocus();
_ui->pushButton_copy->hide();
_ui->pushButton_mail->hide();
_ui->widget_shareLink->show();
_ui->checkBox_expire->setEnabled(false);
_ui->checkBox_editing->setEnabled(false);
@@ -487,26 +475,6 @@ void ShareLinkWidget::slotPushButtonCopyLinkPressed()
#endif
}
void ShareLinkWidget::slotPushButtonMailLinkPressed()
{
QString fileName = _sharePath.mid(_sharePath.lastIndexOf('/') + 1);
if (!QDesktopServices::openUrl(QUrl(QString(
"mailto: "
"?subject=I shared %1 with you"
"&body=%2").arg(
fileName,
_shareUrl),
QUrl::TolerantMode))) {
QMessageBox::warning(
this,
tr("Could not open email client"),
tr("There was an error when launching the email client to "
"create a new message. Maybe no default email client is "
"configured?"));
}
}
void ShareLinkWidget::slotCheckBoxEditingClicked()
{
ShareLinkWidget::setPublicUpload(_ui->checkBox_editing->checkState() == Qt::Checked);
-1
Ver Arquivo
@@ -68,7 +68,6 @@ private slots:
void slotPasswordReturnPressed();
void slotPasswordChanged(const QString& newText);
void slotPushButtonCopyLinkPressed();
void slotPushButtonMailLinkPressed();
void slotCheckBoxEditingClicked();
void slotPublicUploadSet();
-7
Ver Arquivo
@@ -195,13 +195,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_mail">
<property name="text">
<string>&amp;Mail link</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_copy">
<property name="text">
+1 -1
Ver Arquivo
@@ -24,8 +24,8 @@
#include "capabilities.h"
#include "thumbnailjob.h"
#include "share.h"
#include "sharee.h"
#include "sharemanager.h"
#include "QProgressIndicator.h"
#include <QBuffer>
+1 -3
Ver Arquivo
@@ -171,9 +171,7 @@ void SocketApi::slotReadSocket()
Q_ASSERT(socket);
while(socket->canReadLine()) {
// Make sure to normalize the input from the socket to
// make sure that the path will match, especially on OS X.
QString line = QString::fromUtf8(socket->readLine()).normalized(QString::NormalizationForm_C);
QString line = QString::fromUtf8(socket->readLine());
line.chop(1); // remove the '\n'
QString command = line.split(":").value(0);
QString function = QString(QLatin1String("command_")).append(command);
+7 -23
Ver Arquivo
@@ -81,16 +81,13 @@ QString SyncRunFileLog::instructionToStr( csync_instructions_e inst )
case CSYNC_INSTRUCTION_TYPE_CHANGE:
re = "INST_TYPE_CHANGE";
break;
case CSYNC_INSTRUCTION_UPDATE_METADATA:
re = "INST_METADATA";
break;
}
return re;
}
void SyncRunFileLog::start(const QString &folderPath)
void SyncRunFileLog::start(const QString &folderPath, const Utility::StopWatch &stopWatch )
{
const qint64 logfileMaxSize = 1024*1024; // 1MiB
@@ -111,6 +108,8 @@ void SyncRunFileLog::start(const QString &folderPath)
_file->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text);
_out.setDevice( _file.data() );
QDateTime dt = stopWatch.startTime();
QDateTime de = stopWatch.timeOfLap(QLatin1String("Sync Finished"));
if (!exists) {
// We are creating a new file, add the note.
@@ -123,9 +122,8 @@ void SyncRunFileLog::start(const QString &folderPath)
}
_totalDuration.start();
_lapDuration.start();
_out << "#=#=#=# Syncrun started " << dateTimeStr(QDateTime::currentDateTime()) << endl;
_out << "#=#=#=# Syncrun started " << dateTimeStr(dt) << " until " << dateTimeStr(de) << " ("
<< stopWatch.durationOfLap(QLatin1String("Sync Finished")) << " msec)" << endl;
}
void SyncRunFileLog::logItem( const SyncFileItem& item )
@@ -145,11 +143,7 @@ void SyncRunFileLog::logItem( const SyncFileItem& item )
const QChar L = QLatin1Char('|');
_out << ts << L;
_out << QString::number(item._requestDuration) << L;
if( item.log._instruction != CSYNC_INSTRUCTION_RENAME ) {
_out << item._file << L;
} else {
_out << item._file << QLatin1String(" -> ") << item._renameTarget << L;
}
_out << item._file << L;
_out << instructionToStr( item.log._instruction ) << L;
_out << directionToStr( item._direction ) << L;
_out << QString::number(item.log._modtime) << L;
@@ -168,18 +162,8 @@ void SyncRunFileLog::logItem( const SyncFileItem& item )
_out << endl;
}
void SyncRunFileLog::logLap(const QString& name)
void SyncRunFileLog::close()
{
_out << "#=#=#=#=# " << name << " " << dateTimeStr(QDateTime::currentDateTime())
<< " (last step: " << _lapDuration.restart() << " msec"
<< ", total: " << _totalDuration.elapsed() << " msec)" << endl;
}
void SyncRunFileLog::finish()
{
_out << "#=#=#=# Syncrun finished " << dateTimeStr(QDateTime::currentDateTime())
<< " (last step: " << _lapDuration.elapsed() << " msec"
<< ", total: " << _totalDuration.elapsed() << " msec)" << endl;
_file->close();
}
+4 -6
Ver Arquivo
@@ -17,9 +17,9 @@
#include <QFile>
#include <QTextStream>
#include <QScopedPointer>
#include <QElapsedTimer>
#include "syncfileitem.h"
#include "utility.h"
namespace OCC {
class SyncFileItem;
@@ -32,10 +32,9 @@ class SyncRunFileLog
{
public:
SyncRunFileLog();
void start( const QString& folderPath );
void start( const QString& folderPath, const Utility::StopWatch& stopWatch );
void logItem( const SyncFileItem& item );
void logLap( const QString& name );
void finish();
void close();
protected:
@@ -46,8 +45,7 @@ private:
QScopedPointer<QFile> _file;
QTextStream _out;
QElapsedTimer _totalDuration;
QElapsedTimer _lapDuration;
};
}
+6 -12
Ver Arquivo
@@ -30,6 +30,7 @@ OwncloudHttpCredsPage::OwncloudHttpCredsPage(QWidget* parent)
: AbstractCredentialsWizardPage(),
_ui(),
_connected(false),
_checking(false),
_progressIndi(new QProgressIndicator (this))
{
_ui.setupUi(this);
@@ -113,8 +114,6 @@ void OwncloudHttpCredsPage::initializePage()
_ui.lePassword->setText(password);
}
}
_ui.tokenLabel->setText(HttpCredentialsGui::requestAppPasswordText(ocWizard->account().data()));
_ui.tokenLabel->setVisible(!_ui.tokenLabel->text().isEmpty());
_ui.leUsername->setFocus();
}
@@ -132,20 +131,14 @@ bool OwncloudHttpCredsPage::validatePage()
if (!_connected) {
_ui.errorLabel->setVisible(false);
_checking = true;
startSpinner();
// Reset cookies to ensure the username / password is actually used
OwncloudWizard* ocWizard = qobject_cast< OwncloudWizard* >(wizard());
ocWizard->account()->clearCookieJar();
emit completeChanged();
emit connectToOCUrl(field("OCUrl").toString().simplified());
return false;
} else {
// Reset, to require another connection attempt next time
_connected = false;
_checking = false;
emit completeChanged();
stopSpinner();
return true;
@@ -158,9 +151,9 @@ int OwncloudHttpCredsPage::nextId() const
return WizardCommon::Page_AdvancedSetup;
}
void OwncloudHttpCredsPage::setConnected()
void OwncloudHttpCredsPage::setConnected( bool comp )
{
_connected = true;
_connected = comp;
stopSpinner ();
}
@@ -186,6 +179,7 @@ void OwncloudHttpCredsPage::setErrorString(const QString& err)
_ui.errorLabel->setVisible(true);
_ui.errorLabel->setText(err);
}
_checking = false;
emit completeChanged();
stopSpinner();
}
+2 -1
Ver Arquivo
@@ -40,7 +40,7 @@ public:
void cleanupPage() Q_DECL_OVERRIDE;
bool validatePage() Q_DECL_OVERRIDE;
int nextId() const Q_DECL_OVERRIDE;
void setConnected();
void setConnected(bool connected);
void setErrorString( const QString& err );
Q_SIGNALS:
@@ -53,6 +53,7 @@ private:
Ui_OwncloudHttpCredsPage _ui;
bool _connected;
bool _checking;
QProgressIndicator* _progressIndi;
OwncloudWizard* _ocWizard;
};
+35 -48
Ver Arquivo
@@ -7,30 +7,14 @@
<x>0</x>
<y>0</y>
<width>350</width>
<height>248</height>
<height>196</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="5" column="1">
<layout class="QHBoxLayout" name="resultLayout"/>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="topLabel">
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -46,23 +30,7 @@
</property>
</spacer>
</item>
<item row="3" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<item row="1" column="1">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="usernameLabel">
@@ -75,7 +43,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="passwordLabel">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&amp;Password</string>
</property>
@@ -87,7 +55,7 @@
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="errorLabel">
<property name="text">
<string notr="true">Error Label</string>
<string>Error Label</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@@ -106,7 +74,7 @@
</item>
</layout>
</item>
<item row="4" column="1">
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -119,23 +87,42 @@
</property>
</spacer>
</item>
<item row="6" column="0" colspan="3">
<widget class="QLabel" name="bottomLabel">
<property name="text">
<string notr="true">TextLabel</string>
<item row="1" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="tokenLabel">
<item row="3" column="1">
<layout class="QHBoxLayout" name="resultLayout"/>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="topLabel">
<property name="text">
<string notr="true">TextLabel</string>
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="bottomLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
+8 -15
Ver Arquivo
@@ -20,9 +20,7 @@
#include "wizard/owncloudwizard.h"
#include "wizard/owncloudsetuppage.h"
#include "wizard/owncloudhttpcredspage.h"
#ifndef NO_SHIBBOLETH
#include "wizard/owncloudshibbolethcredspage.h"
#endif
#include "wizard/owncloudadvancedsetuppage.h"
#include "wizard/owncloudwizardresultpage.h"
@@ -41,9 +39,7 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
_account(0),
_setupPage(new OwncloudSetupPage(this)),
_httpCredsPage(new OwncloudHttpCredsPage(this)),
#ifndef NO_SHIBBOLETH
_shibbolethCredsPage(new OwncloudShibbolethCredsPage),
#endif
_advancedSetupPage(new OwncloudAdvancedSetupPage),
_resultPage(new OwncloudWizardResultPage),
_credentialsPage(0),
@@ -52,9 +48,7 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setPage(WizardCommon::Page_ServerSetup, _setupPage);
setPage(WizardCommon::Page_HttpCreds, _httpCredsPage);
#ifndef NO_SHIBBOLETH
setPage(WizardCommon::Page_ShibbolethCreds, _shibbolethCredsPage);
#endif
setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
setPage(WizardCommon::Page_Result, _resultPage);
@@ -67,9 +61,7 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
connect( this, SIGNAL(currentIdChanged(int)), SLOT(slotCurrentPageChanged(int)));
connect( _setupPage, SIGNAL(determineAuthType(QString)), SIGNAL(determineAuthType(QString)));
connect( _httpCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString)));
#ifndef NO_SHIBBOLETH
connect( _shibbolethCredsPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString)));
#endif
connect( _advancedSetupPage, SIGNAL(createLocalAndRemoteFolders(QString, QString)),
SIGNAL(createLocalAndRemoteFolders(QString, QString)));
connect(this, SIGNAL(customButtonClicked(int)), this, SIGNAL(skipFolderConfiguration()));
@@ -133,14 +125,12 @@ void OwncloudWizard::successfulStep()
switch (id) {
case WizardCommon::Page_HttpCreds:
_httpCredsPage->setConnected();
_httpCredsPage->setConnected(true);
break;
#ifndef NO_SHIBBOLETH
case WizardCommon::Page_ShibbolethCreds:
_shibbolethCredsPage->setConnected();
break;
#endif
case WizardCommon::Page_AdvancedSetup:
_advancedSetupPage->directoriesCreated();
@@ -158,12 +148,9 @@ void OwncloudWizard::successfulStep()
void OwncloudWizard::setAuthType(WizardCommon::AuthType type)
{
_setupPage->setAuthType(type);
#ifndef NO_SHIBBOLETH
if (type == WizardCommon::Shibboleth) {
_credentialsPage = _shibbolethCredsPage;
} else
#endif
{
} else {
_credentialsPage = _httpCredsPage;
}
next();
@@ -185,6 +172,12 @@ void OwncloudWizard::slotCurrentPageChanged( int id )
}
setOption(QWizard::HaveCustomButton1, id == WizardCommon::Page_AdvancedSetup);
if (id == WizardCommon::Page_AdvancedSetup) {
// Going back from this page messes the state as the account is created already
button(QWizard::BackButton)->setDisabled(true);
}
}
void OwncloudWizard::displayError( const QString& msg, bool retryHTTPonly )
-4
Ver Arquivo
@@ -25,9 +25,7 @@ namespace OCC {
class OwncloudSetupPage;
class OwncloudHttpCredsPage;
#ifndef NO_SHIBBOLETH
class OwncloudShibbolethCredsPage;
#endif
class OwncloudAdvancedSetupPage;
class OwncloudWizardResultPage;
class AbstractCredentials;
@@ -90,9 +88,7 @@ private:
AccountPtr _account;
OwncloudSetupPage* _setupPage;
OwncloudHttpCredsPage* _httpCredsPage;
#ifndef NO_SHIBBOLETH
OwncloudShibbolethCredsPage* _shibbolethCredsPage;
#endif
OwncloudAdvancedSetupPage* _advancedSetupPage;
OwncloudWizardResultPage* _resultPage;
AbstractCredentialsWizardPage* _credentialsPage;
+1
Ver Arquivo
@@ -1,5 +1,6 @@
project(libsync)
set(CMAKE_AUTOMOC TRUE)
include(GenerateExportHeader)
configure_file( version.h.in "${CMAKE_CURRENT_BINARY_DIR}/version.h" )
+1 -1
Ver Arquivo
@@ -43,7 +43,7 @@ namespace OCC {
AbstractNetworkJob::AbstractNetworkJob(AccountPtr account, const QString &path, QObject *parent)
: QObject(parent)
, _timedout(false)
, _followRedirects(true)
, _followRedirects(false)
, _account(account)
, _ignoreCredentialFailure(false)
, _reply(0)
+1
Ver Arquivo
@@ -129,6 +129,7 @@ SystemProxyRunnable::SystemProxyRunnable(const QUrl &url) : QObject(), QRunnable
void SystemProxyRunnable::run()
{
qDebug() << Q_FUNC_INFO << "Starting system proxy lookup";
qRegisterMetaType<QNetworkProxy>("QNetworkProxy");
QList<QNetworkProxy> proxies = QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(_url));
+1 -1
Ver Arquivo
@@ -57,7 +57,7 @@ private:
QUrl _url;
};
OWNCLOUDSYNC_EXPORT QString printQNetworkProxy(const QNetworkProxy &proxy);
QString printQNetworkProxy(const QNetworkProxy &proxy);
}
+8 -25
Ver Arquivo
@@ -210,7 +210,7 @@ int get_errno_from_http_errcode( int err, const QString & reason ) {
DiscoverySingleDirectoryJob::DiscoverySingleDirectoryJob(const AccountPtr &account, const QString &path, QObject *parent)
: QObject(parent), _subPath(path), _account(account), _ignoredFirst(false), _isRootPath(false)
: QObject(parent), _subPath(path), _account(account), _ignoredFirst(false)
{
}
@@ -218,15 +218,10 @@ void DiscoverySingleDirectoryJob::start()
{
// Start the actual HTTP job
LsColJob *lsColJob = new LsColJob(_account, _subPath, this);
QList<QByteArray> props;
props << "resourcetype" << "getlastmodified" << "getcontentlength" << "getetag"
<< "http://owncloud.org/ns:id" << "http://owncloud.org/ns:downloadURL"
<< "http://owncloud.org/ns:dDC" << "http://owncloud.org/ns:permissions";
if (_isRootPath)
props << "http://owncloud.org/ns:data-fingerprint";
lsColJob->setProperties(props);
lsColJob->setProperties(QList<QByteArray>() << "resourcetype" << "getlastmodified"
<< "getcontentlength" << "getetag" << "http://owncloud.org/ns:id"
<< "http://owncloud.org/ns:downloadURL" << "http://owncloud.org/ns:dDC"
<< "http://owncloud.org/ns:permissions");
QObject::connect(lsColJob, SIGNAL(directoryListingIterated(QString,QMap<QString,QString>)),
this, SLOT(directoryListingIteratedSlot(QString,QMap<QString,QString>)));
@@ -304,14 +299,12 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(QString file, con
{
//qDebug() << Q_FUNC_INFO << _subPath << file << map.count() << map.keys() << _account->davPath() << _lsColJob->reply()->request().url().path();
if (!_ignoredFirst) {
// The first entry is for the folder itself, we should process it differently.
// First result is the directory itself. Maybe should have a better check for that? FIXME
_ignoredFirst = true;
if (map.contains("permissions")) {
emit firstDirectoryPermissions(map.value("permissions"));
}
if (map.contains("data-fingerprint")) {
_dataFingerprint = map.value("data-fingerprint").toUtf8();
}
} else {
// Remove <webDAV-Url>/folder/ from <webDAV-Url>/folder/subfile.txt
file.remove(0, _lsColJob->reply()->request().url().path().length());
@@ -433,11 +426,6 @@ void DiscoveryMainThread::doOpendirSlot(const QString &subPath, DiscoveryDirecto
this, SIGNAL(etagConcatenation(QString)));
QObject::connect(_singleDirJob, SIGNAL(etag(QString)),
this, SIGNAL(etag(QString)));
if (!_firstFolderProcessed) {
_singleDirJob->setIsRootPath();
}
_singleDirJob->start();
}
@@ -453,12 +441,7 @@ void DiscoveryMainThread::singleDirectoryJobResultSlot(const QList<FileStatPoint
_currentDiscoveryDirectoryResult->list = result;
_currentDiscoveryDirectoryResult->code = 0;
_currentDiscoveryDirectoryResult->listIndex = 0;
_currentDiscoveryDirectoryResult = 0; // the sync thread owns it now
if (!_firstFolderProcessed) {
_firstFolderProcessed = true;
_dataFingerprint = _singleDirJob->_dataFingerprint;
}
_currentDiscoveryDirectoryResult = 0; // the sync thread owns it now
_discoveryJob->_vioMutex.lock();
_discoveryJob->_vioWaitCondition.wakeAll();
+1 -13
Ver Arquivo
@@ -81,8 +81,6 @@ class DiscoverySingleDirectoryJob : public QObject {
Q_OBJECT
public:
explicit DiscoverySingleDirectoryJob(const AccountPtr &account, const QString &path, QObject *parent = 0);
// Specify thgat this is the root and we need to check the data-fingerprint
void setIsRootPath() { _isRootPath = true; }
void start();
void abort();
// This is not actually a network job, it is just a job
@@ -102,15 +100,8 @@ private:
QString _etagConcatenation;
QString _firstEtag;
AccountPtr _account;
// The first result is for the directory itself and need to be ignored.
// This flag is true if it was already ignored.
bool _ignoredFirst;
// Set to true if this is the root path and we need to check the data-fingerprint
bool _isRootPath;
QPointer<LsColJob> _lsColJob;
public:
QByteArray _dataFingerprint;
};
// Lives in main thread. Deleted by the SyncEngine
@@ -124,16 +115,13 @@ class DiscoveryMainThread : public QObject {
AccountPtr _account;
DiscoveryDirectoryResult *_currentDiscoveryDirectoryResult;
qint64 *_currentGetSizeResult;
bool _firstFolderProcessed;
public:
DiscoveryMainThread(AccountPtr account) : QObject(), _account(account),
_currentDiscoveryDirectoryResult(0), _currentGetSizeResult(0), _firstFolderProcessed(false)
_currentDiscoveryDirectoryResult(0), _currentGetSizeResult(0)
{ }
void abort();
QByteArray _dataFingerprint;
public slots:
// From DiscoveryJob:
+3 -19
Ver Arquivo
@@ -46,13 +46,6 @@ void ExcludedFiles::addExcludeFilePath(const QString& path)
_excludeFiles.insert(path);
}
#ifdef WITH_UNIT_TESTING
void ExcludedFiles::addExcludeExpr(const QString &expr)
{
_csync_exclude_add(_excludesPtr, expr.toLatin1().constData());
}
#endif
bool ExcludedFiles::reloadExcludes()
{
c_strlist_destroy(*_excludesPtr);
@@ -76,22 +69,13 @@ bool ExcludedFiles::isExcluded(
return true;
}
QFileInfo fi(filePath);
if( excludeHidden ) {
QString path = filePath;
// Check all path subcomponents, but to *not* check the base path:
// We do want to be able to sync with a hidden folder as the target.
while (path.size() > basePath.size()) {
QFileInfo fi(path);
if( fi.isHidden() || fi.fileName().startsWith(QLatin1Char('.')) ) {
return true;
}
// Get the parent path
path = fi.absolutePath();
if( fi.isHidden() || fi.fileName().startsWith(QLatin1Char('.')) ) {
return true;
}
}
QFileInfo fi(filePath);
csync_ftw_type_e type = CSYNC_FTW_TYPE_FILE;
if (fi.isDir()) {
type = CSYNC_FTW_TYPE_DIR;
-4
Ver Arquivo
@@ -57,10 +57,6 @@ public:
const QString& basePath,
bool excludeHidden) const;
#ifdef WITH_UNIT_TESTING
void addExcludeExpr(const QString &expr);
#endif
public slots:
/**
* Reloads the exclude patterns from the registered paths.

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais