Comparar commits
76 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 0275c1c7dc | |||
| 960ec92f70 | |||
| 94a21b690c | |||
| 9846756afc | |||
| aabae3d6ff | |||
| 95f73b88d8 | |||
| 6af54458f0 | |||
| 79f1ce0876 | |||
| 69b865e099 | |||
| 0b1e6b21ae | |||
| ee93a09761 | |||
| 5815c54254 | |||
| 98ecc20852 | |||
| d816d668ec | |||
| 5d1ab587f7 | |||
| 85dfead259 | |||
| 4bb763128e | |||
| 6d3f4db2dd | |||
| 3dc5f84b41 | |||
| 379b5292ad | |||
| 2454cc3f56 | |||
| bb5c2cbfa5 | |||
| 60904496d2 | |||
| 94c9a2cca1 | |||
| 73a6939b70 | |||
| 88e5a9411a | |||
| d58c392d93 | |||
| 5ac434a740 | |||
| a83c5598e8 | |||
| eadecc5802 | |||
| 39bde6f3e4 | |||
| 3465024898 | |||
| 7c671756e6 | |||
| 0c6788f03d | |||
| 6bd4de19a8 | |||
| 927a8b5071 | |||
| a4310f0f5c | |||
| cb64ba22b3 | |||
| b21e3e0fdc | |||
| 4979181e85 | |||
| 699d1ba13b | |||
| 3c575a2f37 | |||
| bd7ec19644 | |||
| 3f3a679f81 | |||
| cde9017340 | |||
| 6e9df8673f | |||
| 681243277e | |||
| cb50fae0a7 | |||
| 73cc3a4fd4 | |||
| d655074f85 | |||
| 85a173e174 | |||
| 87b4693a9d | |||
| 28c12a3ca0 | |||
| 66f041f74c | |||
| 6d02d76cfd | |||
| 48efbcb8ca | |||
| 86680a53e0 | |||
| e031f7d090 | |||
| d4b72132d6 | |||
| 763016bd8f | |||
| 7f0cc5b699 | |||
| d3a93cbaeb | |||
| 85d3c7a263 | |||
| 159535fe90 | |||
| 088a294fac | |||
| 813bc15a78 | |||
| 567fe87e98 | |||
| a1ba23eea9 | |||
| 194db066b6 | |||
| 129c17651a | |||
| 0469236d80 | |||
| 93e0d52dd3 | |||
| 9f3e576348 | |||
| 5479aaeb5b | |||
| 8dc178a9f3 | |||
| 35d4b96339 |
externo
+58
@@ -0,0 +1,58 @@
|
||||
#!groovy
|
||||
|
||||
node('CLIENT') {
|
||||
stage 'Checkout'
|
||||
checkout scm
|
||||
sh '''git submodule update --init'''
|
||||
|
||||
stage 'Qt4'
|
||||
sh '''rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DUNIT_TESTING=1 -DBUILD_WITH_QT4=ON ..
|
||||
make
|
||||
ctest --output-on-failure'''
|
||||
|
||||
stage 'Qt4 - clang'
|
||||
sh '''rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DUNIT_TESTING=1 -DBUILD_WITH_QT4=ON ..
|
||||
make
|
||||
ctest --output-on-failure'''
|
||||
|
||||
stage 'Qt5'
|
||||
sh '''rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DUNIT_TESTING=1 -DBUILD_WITH_QT4=OFF ..
|
||||
make
|
||||
ctest --output-on-failure'''
|
||||
|
||||
stage 'Qt5 - clang'
|
||||
sh '''rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DUNIT_TESTING=1 -DBUILD_WITH_QT4=OFF ..
|
||||
make
|
||||
ctest --output-on-failure'''
|
||||
|
||||
|
||||
stage 'Win32'
|
||||
def win32 = docker.image('deepdiver/docker-owncloud-client-win32:latest')
|
||||
win32.pull() // make sure we have the latest available from Docker Hub
|
||||
win32.inside {
|
||||
sh '''
|
||||
rm -rf build-win32
|
||||
mkdir build-win32
|
||||
cd build-win32
|
||||
../admin/win/download_runtimes.sh
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../admin/win/Toolchain-mingw32-openSUSE.cmake -DWITH_CRASHREPORTER=ON
|
||||
make -j4
|
||||
make package
|
||||
ctest .
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
set( MIRALL_VERSION_MAJOR 2 )
|
||||
set( MIRALL_VERSION_MINOR 2 )
|
||||
set( MIRALL_VERSION_PATCH 3 )
|
||||
set( MIRALL_VERSION_MINOR 3 )
|
||||
set( MIRALL_VERSION_PATCH 0 )
|
||||
set( MIRALL_VERSION_YEAR 2016 )
|
||||
set( MIRALL_SOVERSION 0 )
|
||||
|
||||
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
||||
set( MIRALL_VERSION_SUFFIX "beta1") #e.g. beta1, beta2, rc1
|
||||
set( MIRALL_VERSION_SUFFIX "git") #e.g. beta1, beta2, rc1
|
||||
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
||||
|
||||
if( NOT DEFINED MIRALL_VERSION_BUILD )
|
||||
|
||||
@@ -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 ve slo§ce '$INSTDIR'.$\n$\nChcete pokraŸovat (nedoporuŸuje se)?"
|
||||
StrCpy $UNINSTALL_MESSAGEBOX "Nezd se, §e ${APPLICATION_NAME} je nainstalov na v adres ýi '$INSTDIR'.$\n$\nChcete pokraŸovat (nedoporuŸuje se)?"
|
||||
StrCpy $UNINSTALL_ABORT "Odinstalace zruçena u§ivatelem"
|
||||
StrCpy $INIT_NO_QUICK_LAUNCH "Z stupce rychl‚ho spuçtØn¡ (nen¡ k dispozici)"
|
||||
StrCpy $INIT_NO_DESKTOP "Z stupce na ploçe (pýep¡çe existuj¡c¡)"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Auto-generated - do not modify
|
||||
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostrar notas de lançamento"
|
||||
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 $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 nenhum 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 $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 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_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_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 da área de trabalho"
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "A criar atalhos na á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 no ambiente de trabalho de ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Atalho do ambiente de trabalho para ${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 ${APPLICATION_NAME} esteja instalado no diretório '$INSTDIR'.$\n$\nContinuar na mesma (não recomendado)?"
|
||||
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_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)"
|
||||
|
||||
@@ -9,6 +9,7 @@ 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}"
|
||||
@@ -37,7 +38,6 @@ 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!"
|
||||
|
||||
@@ -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 detener no encontrado!"
|
||||
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "¡Proceso para finalizar 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"
|
||||
|
||||
@@ -9,6 +9,7 @@ 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}"
|
||||
@@ -40,4 +41,3 @@ 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,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 "ไม่พบการฆ่ากระบวนการ!"
|
||||
|
||||
@@ -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 "Norwegian"
|
||||
!insertmacro MUI_LANGUAGE "Catalan"
|
||||
!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 "German"
|
||||
!insertmacro MUI_LANGUAGE "Czech"
|
||||
!insertmacro MUI_LANGUAGE "Japanese"
|
||||
!insertmacro MUI_LANGUAGE "Galician"
|
||||
!insertmacro MUI_LANGUAGE "Czech"
|
||||
!insertmacro MUI_LANGUAGE "German"
|
||||
!insertmacro MUI_LANGUAGE "Slovak"
|
||||
!insertmacro MUI_LANGUAGE "Spanish"
|
||||
!insertmacro MUI_LANGUAGE "Polish"
|
||||
|
||||
@@ -98,6 +98,7 @@ 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,
|
||||
|
||||
@@ -243,9 +243,14 @@ 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 && (bname[blen-1]== ' ' || bname[blen-1]== '.' )) {
|
||||
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
|
||||
goto out;
|
||||
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 (csync_is_windows_reserved_word(bname)) {
|
||||
|
||||
@@ -27,6 +27,7 @@ enum csync_exclude_type_e {
|
||||
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
|
||||
|
||||
@@ -477,6 +477,8 @@ 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 ) {
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
static void setup(void **state) {
|
||||
CSYNC *csync;
|
||||
int rc;
|
||||
|
||||
csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
||||
|
||||
@@ -179,6 +178,20 @@ 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)
|
||||
@@ -305,13 +318,14 @@ 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 (int i = 0; i < N; ++i) {
|
||||
for (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);
|
||||
}
|
||||
@@ -329,7 +343,7 @@ static void check_csync_excluded_performance(void **state)
|
||||
struct timeval before, after;
|
||||
gettimeofday(&before, 0);
|
||||
|
||||
for (int i = 0; i < N; ++i) {
|
||||
for (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);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ static void teardown(void **state) {
|
||||
static void check_csync_init(void **state)
|
||||
{
|
||||
CSYNC *csync = *state;
|
||||
int rc;
|
||||
|
||||
csync_init(csync);
|
||||
|
||||
|
||||
@@ -31,6 +31,13 @@ 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
-1
@@ -7,7 +7,7 @@ On Microsoft Windows systems:
|
||||
``%LOCALAPPDATA%\ownCloud\owncloud.cfg``
|
||||
|
||||
On MAC OS X systems:
|
||||
``$HOME/Library/Application Support/ownCloud``
|
||||
``$HOME/Library/Application Support/ownCloud/owncloud.cfg``
|
||||
|
||||
|
||||
The configuration file contains settings using the Microsoft Windows .ini file
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ logs.
|
||||
|
||||
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/1.8/troubleshooting.html#client-logfile )
|
||||
(See also http://doc.owncloud.org/desktop/2.2/troubleshooting.html#client-logfile )
|
||||
|
||||
2. Web server error log:
|
||||
|
||||
|
||||
+4
-1
@@ -18,6 +18,7 @@
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <qdebug.h>
|
||||
|
||||
#include "account.h"
|
||||
@@ -196,10 +197,12 @@ void parseOptions( const QStringList& app_args, CmdOptions *options )
|
||||
if (!options->source_dir.endsWith('/')) {
|
||||
options->source_dir.append('/');
|
||||
}
|
||||
if( !QFile::exists( options->source_dir )) {
|
||||
QFileInfo fi(options->source_dir);
|
||||
if( !fi.exists() ) {
|
||||
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;
|
||||
|
||||
@@ -248,6 +248,9 @@ 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";
|
||||
@@ -271,6 +274,7 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
|
||||
_ui->_notifyScroll->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
|
||||
#endif
|
||||
_widgetForNotifId[activity.ident()] = widget;
|
||||
newNotificationShown = true;
|
||||
}
|
||||
|
||||
widget->setActivity( activity );
|
||||
@@ -365,6 +369,10 @@ 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)
|
||||
@@ -517,6 +525,7 @@ 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"));
|
||||
@@ -582,6 +591,13 @@ void ActivitySettings::slotShowIssueItemCount(int cnt)
|
||||
_tab->setTabText(_syncIssueTabId, cntText);
|
||||
}
|
||||
|
||||
void ActivitySettings::slotShowActivityTab()
|
||||
{
|
||||
if (_activityTabId != -1) {
|
||||
_tab->setCurrentIndex(_activityTabId);
|
||||
}
|
||||
}
|
||||
|
||||
void ActivitySettings::slotCopyToClipboard()
|
||||
{
|
||||
QString text;
|
||||
|
||||
@@ -81,7 +81,7 @@ signals:
|
||||
void copyToClipboard();
|
||||
void rowsInserted();
|
||||
void hideActivityTab(bool);
|
||||
void newNotificationList(const ActivityList& list);
|
||||
void newNotification();
|
||||
|
||||
private slots:
|
||||
void slotBuildNotificationDisplay(const ActivityList& list);
|
||||
@@ -143,6 +143,7 @@ private slots:
|
||||
void setActivityTabHidden(bool hidden);
|
||||
void slotRegularNotificationCheck();
|
||||
void slotShowIssueItemCount(int cnt);
|
||||
void slotShowActivityTab();
|
||||
|
||||
signals:
|
||||
void guiLog(const QString&, const QString&);
|
||||
|
||||
@@ -354,10 +354,11 @@ void Application::setupLogging()
|
||||
|
||||
Logger::instance()->enterNextLogFile();
|
||||
|
||||
qDebug() << QString::fromLatin1( "################## %1 %2 (%3) %4").arg(_theme->appName())
|
||||
qDebug() << QString::fromLatin1( "################## %1 %2 (%3) %4 on %5").arg(_theme->appName())
|
||||
.arg( QLocale::system().name() )
|
||||
.arg(property("ui_lang").toString())
|
||||
.arg(_theme->version());
|
||||
.arg(_theme->version())
|
||||
.arg(Utility::platformName());
|
||||
|
||||
// Setup CSYNC logging to forward to our own logger
|
||||
csync_set_log_callback( csyncLogCatcher );
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QLabel>
|
||||
#include "creds/httpcredentialsgui.h"
|
||||
#include "theme.h"
|
||||
#include "account.h"
|
||||
@@ -31,26 +32,52 @@ void HttpCredentialsGui::askFromUser()
|
||||
|
||||
void HttpCredentialsGui::askFromUserAsync()
|
||||
{
|
||||
QString msg = tr("Please enter %1 password:\n"
|
||||
"\n"
|
||||
"User: %2\n"
|
||||
"Account: %3\n")
|
||||
.arg(Theme::instance()->appNameGUI(), _user, _account->displayName());
|
||||
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>");
|
||||
}
|
||||
if (!_fetchErrorString.isEmpty()) {
|
||||
msg += QLatin1String("\n") + tr("Reading from keychain failed with error: '%1'").arg(
|
||||
_fetchErrorString) + QLatin1String("\n");
|
||||
msg += QLatin1String("<br>") + tr("Reading from keychain failed with error: '%1'").arg(
|
||||
Utility::escape(_fetchErrorString)) + QLatin1String("<br>");
|
||||
}
|
||||
|
||||
bool ok = false;
|
||||
QString pwd = QInputDialog::getText(0, tr("Enter Password"), msg,
|
||||
QLineEdit::Password, _previousPassword,
|
||||
&ok);
|
||||
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();
|
||||
if (ok) {
|
||||
_password = pwd;
|
||||
_password = dialog.textValue();
|
||||
_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
|
||||
|
||||
@@ -30,6 +30,8 @@ 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
|
||||
|
||||
+14
-10
@@ -62,6 +62,7 @@ Folder::Folder(const FolderDefinition& definition,
|
||||
, _consecutiveFailingSyncs(0)
|
||||
, _consecutiveFollowUpSyncs(0)
|
||||
, _journal(definition.localPath)
|
||||
, _fileLog(new SyncRunFileLog)
|
||||
{
|
||||
qRegisterMetaType<SyncFileItemVector>("SyncFileItemVector");
|
||||
qRegisterMetaType<SyncFileItem::Direction>("SyncFileItem::Direction");
|
||||
@@ -109,6 +110,8 @@ 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()
|
||||
@@ -364,18 +367,11 @@ 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() ) {
|
||||
// Log the item
|
||||
syncFileLog.logItem( *item );
|
||||
|
||||
// and process the item to the gui
|
||||
// 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) );
|
||||
@@ -440,7 +436,6 @@ void Folder::bubbleUpSyncResult()
|
||||
}
|
||||
}
|
||||
}
|
||||
syncFileLog.close();
|
||||
|
||||
qDebug() << "Processing result list and logging took " << timer.elapsed() << " Milliseconds.";
|
||||
_syncResult.setWarnCount(ignoredItems);
|
||||
@@ -758,6 +753,8 @@ 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
|
||||
@@ -821,6 +818,7 @@ void Folder::slotSyncFinished(bool success)
|
||||
} else {
|
||||
qDebug() << "-> SyncEngine finished without problem.";
|
||||
}
|
||||
_fileLog->finish();
|
||||
bubbleUpSyncResult();
|
||||
|
||||
bool anotherSyncNeeded = _engine->isAnotherSyncNeeded();
|
||||
@@ -927,6 +925,7 @@ 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,6 +963,11 @@ void Folder::slotNewBigFolderDiscovered(const QString &newF)
|
||||
}
|
||||
}
|
||||
|
||||
void Folder::slotLogPropagationStart()
|
||||
{
|
||||
_fileLog->logLap("Propagation starts");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel)
|
||||
@@ -998,7 +1002,7 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel)
|
||||
void Folder::slotAboutToRestoreBackup(bool *restore)
|
||||
{
|
||||
QString msg =
|
||||
tr("This sync would reset the files to an erlier time in the sync folder '%1'.\n"
|
||||
tr("This sync would reset the files to an earlier 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. "
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace OCC {
|
||||
|
||||
class SyncEngine;
|
||||
class AccountState;
|
||||
class SyncRunFileLog;
|
||||
|
||||
/**
|
||||
* @brief The FolderDefinition class
|
||||
@@ -263,6 +264,8 @@ private slots:
|
||||
|
||||
void slotNewBigFolderDiscovered(const QString &);
|
||||
|
||||
void slotLogPropagationStart();
|
||||
|
||||
private:
|
||||
bool setIgnoredFiles();
|
||||
|
||||
@@ -311,6 +314,8 @@ private:
|
||||
SyncJournalDb _journal;
|
||||
|
||||
ClientProxy _clientProxy;
|
||||
|
||||
QScopedPointer<SyncRunFileLog> _fileLog;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
|
||||
QStringList sortedSubfolders = list;
|
||||
// skip the parent item (first in the list)
|
||||
sortedSubfolders.erase(sortedSubfolders.begin());
|
||||
sortedSubfolders.sort();
|
||||
Utility::sortFilenames(sortedSubfolders);
|
||||
|
||||
QVarLengthArray<int, 10> undecidedIndexes;
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ void FolderWizardRemotePath::slotUpdateDirectories(const QStringList &list)
|
||||
root->setData(0, Qt::UserRole, "/");
|
||||
}
|
||||
QStringList sortedList = list;
|
||||
sortedList.sort();
|
||||
Utility::sortFilenames(sortedList);
|
||||
foreach (QString path, sortedList) {
|
||||
path.remove(webdavFolder);
|
||||
QStringList paths = path.split('/');
|
||||
|
||||
@@ -142,11 +142,15 @@ void OwncloudSetupWizard::slotDetermineAuthType(const QString &urlString)
|
||||
|
||||
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(CheckServerJob::version(info)));
|
||||
.arg(serverVersion));
|
||||
|
||||
_ocWizard->account()->setServerVersion(serverVersion);
|
||||
|
||||
QString p = url.path();
|
||||
if (p.endsWith("/status.php")) {
|
||||
|
||||
@@ -93,7 +93,6 @@ private:
|
||||
OwncloudWizard* _ocWizard;
|
||||
QString _initLocalFolder;
|
||||
QString _remoteFolder;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ void SelectiveSyncTreeView::slotUpdateDirectories(QStringList list)
|
||||
}
|
||||
}
|
||||
|
||||
list.sort();
|
||||
Utility::sortFilenames(list);
|
||||
foreach (QString path, list) {
|
||||
auto size = job ? job->_sizes.value(path) : 0;
|
||||
path.remove(pathToRemove);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <QBuffer>
|
||||
#include <QClipboard>
|
||||
#include <QFileInfo>
|
||||
#include <QDesktopServices>
|
||||
|
||||
namespace OCC {
|
||||
|
||||
@@ -53,6 +54,10 @@ 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();
|
||||
@@ -224,6 +229,7 @@ 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);
|
||||
@@ -268,6 +274,7 @@ 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
|
||||
@@ -324,6 +331,7 @@ 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);
|
||||
@@ -339,6 +347,7 @@ 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);
|
||||
@@ -368,6 +377,7 @@ void ShareLinkWidget::slotCheckBoxShareLinkClicked()
|
||||
_ui->checkBox_editing->setEnabled(false);
|
||||
_ui->lineEdit_password->setFocus();
|
||||
_ui->pushButton_copy->hide();
|
||||
_ui->pushButton_mail->hide();
|
||||
_ui->widget_shareLink->show();
|
||||
|
||||
slotCheckBoxPasswordClicked();
|
||||
@@ -413,6 +423,7 @@ 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);
|
||||
@@ -473,6 +484,19 @@ void ShareLinkWidget::slotPushButtonCopyLinkPressed()
|
||||
#endif
|
||||
}
|
||||
|
||||
void ShareLinkWidget::slotPushButtonMailLinkPressed()
|
||||
{
|
||||
QString fileName = _sharePath.mid(_sharePath.lastIndexOf('/') + 1);
|
||||
|
||||
QDesktopServices::openUrl(QUrl(QString(
|
||||
"mailto: "
|
||||
"?subject=I shared %1 with you"
|
||||
"&body=%2").arg(
|
||||
fileName,
|
||||
_shareUrl),
|
||||
QUrl::TolerantMode));
|
||||
}
|
||||
|
||||
void ShareLinkWidget::slotCheckBoxEditingClicked()
|
||||
{
|
||||
ShareLinkWidget::setPublicUpload(_ui->checkBox_editing->checkState() == Qt::Checked);
|
||||
|
||||
@@ -68,6 +68,7 @@ private slots:
|
||||
void slotPasswordReturnPressed();
|
||||
void slotPasswordChanged(const QString& newText);
|
||||
void slotPushButtonCopyLinkPressed();
|
||||
void slotPushButtonMailLinkPressed();
|
||||
void slotCheckBoxEditingClicked();
|
||||
void slotPublicUploadSet();
|
||||
|
||||
|
||||
@@ -195,6 +195,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_mail">
|
||||
<property name="text">
|
||||
<string>&Mail link</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_copy">
|
||||
<property name="text">
|
||||
|
||||
@@ -171,7 +171,9 @@ void SocketApi::slotReadSocket()
|
||||
Q_ASSERT(socket);
|
||||
|
||||
while(socket->canReadLine()) {
|
||||
QString line = QString::fromUtf8(socket->readLine());
|
||||
// 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);
|
||||
line.chop(1); // remove the '\n'
|
||||
QString command = line.split(":").value(0);
|
||||
QString function = QString(QLatin1String("command_")).append(command);
|
||||
|
||||
@@ -87,7 +87,7 @@ QString SyncRunFileLog::instructionToStr( csync_instructions_e inst )
|
||||
}
|
||||
|
||||
|
||||
void SyncRunFileLog::start(const QString &folderPath, const Utility::StopWatch &stopWatch )
|
||||
void SyncRunFileLog::start(const QString &folderPath)
|
||||
{
|
||||
const qint64 logfileMaxSize = 1024*1024; // 1MiB
|
||||
|
||||
@@ -108,8 +108,6 @@ void SyncRunFileLog::start(const QString &folderPath, const Utility::StopWatch
|
||||
_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.
|
||||
@@ -122,8 +120,9 @@ void SyncRunFileLog::start(const QString &folderPath, const Utility::StopWatch
|
||||
}
|
||||
|
||||
|
||||
_out << "#=#=#=# Syncrun started " << dateTimeStr(dt) << " until " << dateTimeStr(de) << " ("
|
||||
<< stopWatch.durationOfLap(QLatin1String("Sync Finished")) << " msec)" << endl;
|
||||
_totalDuration.start();
|
||||
_lapDuration.start();
|
||||
_out << "#=#=#=# Syncrun started " << dateTimeStr(QDateTime::currentDateTime()) << endl;
|
||||
}
|
||||
|
||||
void SyncRunFileLog::logItem( const SyncFileItem& item )
|
||||
@@ -162,8 +161,18 @@ void SyncRunFileLog::logItem( const SyncFileItem& item )
|
||||
_out << endl;
|
||||
}
|
||||
|
||||
void SyncRunFileLog::close()
|
||||
void SyncRunFileLog::logLap(const QString& name)
|
||||
{
|
||||
_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();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QScopedPointer>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
#include "syncfileitem.h"
|
||||
#include "utility.h"
|
||||
|
||||
namespace OCC {
|
||||
class SyncFileItem;
|
||||
@@ -32,9 +32,10 @@ class SyncRunFileLog
|
||||
{
|
||||
public:
|
||||
SyncRunFileLog();
|
||||
void start( const QString& folderPath, const Utility::StopWatch& stopWatch );
|
||||
void start( const QString& folderPath );
|
||||
void logItem( const SyncFileItem& item );
|
||||
void close();
|
||||
void logLap( const QString& name );
|
||||
void finish();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -45,7 +46,8 @@ private:
|
||||
|
||||
QScopedPointer<QFile> _file;
|
||||
QTextStream _out;
|
||||
|
||||
QElapsedTimer _totalDuration;
|
||||
QElapsedTimer _lapDuration;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -76,15 +76,6 @@ void OwncloudAdvancedSetupPage::setupCustomization()
|
||||
_ui.topLabel->hide();
|
||||
_ui.bottomLabel->hide();
|
||||
|
||||
Theme *theme = Theme::instance();
|
||||
QVariant variant = theme->customMedia( Theme::oCSetupTop );
|
||||
if( !variant.isNull() ) {
|
||||
WizardCommon::setupCustomMedia( variant, _ui.topLabel );
|
||||
}
|
||||
|
||||
variant = theme->customMedia( Theme::oCSetupBottom );
|
||||
WizardCommon::setupCustomMedia( variant, _ui.bottomLabel );
|
||||
}
|
||||
|
||||
bool OwncloudAdvancedSetupPage::isComplete() const
|
||||
{
|
||||
|
||||
@@ -71,15 +71,6 @@ void OwncloudHttpCredsPage::setupCustomization()
|
||||
// set defaults for the customize labels.
|
||||
_ui.topLabel->hide();
|
||||
_ui.bottomLabel->hide();
|
||||
|
||||
Theme *theme = Theme::instance();
|
||||
QVariant variant = theme->customMedia( Theme::oCSetupTop );
|
||||
if( !variant.isNull() ) {
|
||||
WizardCommon::setupCustomMedia( variant, _ui.topLabel );
|
||||
}
|
||||
|
||||
variant = theme->customMedia( Theme::oCSetupBottom );
|
||||
WizardCommon::setupCustomMedia( variant, _ui.bottomLabel );
|
||||
}
|
||||
|
||||
void OwncloudHttpCredsPage::initializePage()
|
||||
@@ -114,6 +105,8 @@ 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();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,30 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>196</height>
|
||||
<height>248</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<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">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -30,7 +46,23 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<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">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="usernameLabel">
|
||||
@@ -43,7 +75,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="passwordLabel">
|
||||
<property name="text">
|
||||
<string>&Password</string>
|
||||
</property>
|
||||
@@ -55,7 +87,7 @@
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="errorLabel">
|
||||
<property name="text">
|
||||
<string>Error Label</string>
|
||||
<string notr="true">Error Label</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
@@ -74,7 +106,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="4" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -87,42 +119,23 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" 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">
|
||||
<layout class="QHBoxLayout" name="resultLayout"/>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="topLabel">
|
||||
<item row="6" column="0" colspan="3">
|
||||
<widget class="QLabel" name="bottomLabel">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="tokenLabel">
|
||||
<property name="text">
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="3">
|
||||
<widget class="QLabel" name="bottomLabel">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -85,20 +85,12 @@ void OwncloudSetupPage::setServerUrl( const QString& newUrl )
|
||||
_ui.leUrl->setText( _oCUrl );
|
||||
}
|
||||
|
||||
// TODO: remove me after removing top/bottom label
|
||||
void OwncloudSetupPage::setupCustomization()
|
||||
{
|
||||
// set defaults for the customize labels.
|
||||
_ui.topLabel->hide();
|
||||
_ui.bottomLabel->hide();
|
||||
|
||||
Theme *theme = Theme::instance();
|
||||
QVariant variant = theme->customMedia( Theme::oCSetupTop );
|
||||
if( !variant.isNull() ) {
|
||||
WizardCommon::setupCustomMedia( variant, _ui.topLabel );
|
||||
}
|
||||
|
||||
variant = theme->customMedia( Theme::oCSetupBottom );
|
||||
WizardCommon::setupCustomMedia( variant, _ui.bottomLabel );
|
||||
}
|
||||
|
||||
// slot hit from textChanged of the url entry field.
|
||||
|
||||
@@ -26,26 +26,6 @@ namespace OCC
|
||||
namespace WizardCommon
|
||||
{
|
||||
|
||||
void setupCustomMedia( const QVariant& variant, QLabel *label )
|
||||
{
|
||||
if( !label ) return;
|
||||
|
||||
QPixmap pix = variant.value<QPixmap>();
|
||||
if( !pix.isNull() ) {
|
||||
label->setPixmap(pix);
|
||||
label->setAlignment( Qt::AlignTop | Qt::AlignRight );
|
||||
label->setVisible(true);
|
||||
} else {
|
||||
QString str = variant.toString();
|
||||
if( !str.isEmpty() ) {
|
||||
label->setText( str );
|
||||
label->setTextFormat( Qt::RichText );
|
||||
label->setVisible(true);
|
||||
label->setOpenExternalLinks(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString titleTemplate()
|
||||
{
|
||||
return QString::fromLatin1("<font color=\"%1\" size=\"5\">").arg(Theme::instance()->wizardHeaderTitleColor().name()) + QString::fromLatin1("%1</font>");
|
||||
|
||||
@@ -84,9 +84,6 @@ void OwncloudWizardResultPage::setupCustomization()
|
||||
// set defaults for the customize labels.
|
||||
_ui.topLabel->setText( QString::null );
|
||||
_ui.topLabel->hide();
|
||||
|
||||
QVariant variant = Theme::instance()->customMedia( Theme::oCSetupResultTop );
|
||||
WizardCommon::setupCustomMedia( variant, _ui.topLabel );
|
||||
}
|
||||
|
||||
void OwncloudWizardResultPage::slotOpenLocal()
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OCC {
|
||||
AbstractNetworkJob::AbstractNetworkJob(AccountPtr account, const QString &path, QObject *parent)
|
||||
: QObject(parent)
|
||||
, _timedout(false)
|
||||
, _followRedirects(false)
|
||||
, _followRedirects(true)
|
||||
, _account(account)
|
||||
, _ignoreCredentialFailure(false)
|
||||
, _reply(0)
|
||||
|
||||
@@ -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)
|
||||
: QObject(parent), _subPath(path), _account(account), _ignoredFirst(false), _isRootPath(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -218,10 +218,15 @@ void DiscoverySingleDirectoryJob::start()
|
||||
{
|
||||
// Start the actual HTTP job
|
||||
LsColJob *lsColJob = new LsColJob(_account, _subPath, this);
|
||||
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");
|
||||
|
||||
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);
|
||||
|
||||
QObject::connect(lsColJob, SIGNAL(directoryListingIterated(QString,QMap<QString,QString>)),
|
||||
this, SLOT(directoryListingIteratedSlot(QString,QMap<QString,QString>)));
|
||||
@@ -299,12 +304,14 @@ 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) {
|
||||
// First result is the directory itself. Maybe should have a better check for that? FIXME
|
||||
// The first entry is for the folder itself, we should process it differently.
|
||||
_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());
|
||||
@@ -426,6 +433,11 @@ 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();
|
||||
}
|
||||
|
||||
@@ -441,7 +453,12 @@ void DiscoveryMainThread::singleDirectoryJobResultSlot(const QList<FileStatPoint
|
||||
_currentDiscoveryDirectoryResult->list = result;
|
||||
_currentDiscoveryDirectoryResult->code = 0;
|
||||
_currentDiscoveryDirectoryResult->listIndex = 0;
|
||||
_currentDiscoveryDirectoryResult = 0; // the sync thread owns it now
|
||||
_currentDiscoveryDirectoryResult = 0; // the sync thread owns it now
|
||||
|
||||
if (!_firstFolderProcessed) {
|
||||
_firstFolderProcessed = true;
|
||||
_dataFingerprint = _singleDirJob->_dataFingerprint;
|
||||
}
|
||||
|
||||
_discoveryJob->_vioMutex.lock();
|
||||
_discoveryJob->_vioWaitCondition.wakeAll();
|
||||
|
||||
@@ -81,6 +81,8 @@ 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
|
||||
@@ -100,8 +102,15 @@ 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
|
||||
@@ -115,13 +124,16 @@ class DiscoveryMainThread : public QObject {
|
||||
AccountPtr _account;
|
||||
DiscoveryDirectoryResult *_currentDiscoveryDirectoryResult;
|
||||
qint64 *_currentGetSizeResult;
|
||||
bool _firstFolderProcessed;
|
||||
|
||||
public:
|
||||
DiscoveryMainThread(AccountPtr account) : QObject(), _account(account),
|
||||
_currentDiscoveryDirectoryResult(0), _currentGetSizeResult(0)
|
||||
_currentDiscoveryDirectoryResult(0), _currentGetSizeResult(0), _firstFolderProcessed(false)
|
||||
{ }
|
||||
void abort();
|
||||
|
||||
QByteArray _dataFingerprint;
|
||||
|
||||
|
||||
public slots:
|
||||
// From DiscoveryJob:
|
||||
|
||||
@@ -359,7 +359,6 @@ CheckServerJob::CheckServerJob(AccountPtr account, QObject *parent)
|
||||
: AbstractNetworkJob(account, QLatin1String(statusphpC) , parent)
|
||||
, _subdirFallback(false)
|
||||
{
|
||||
_followRedirects = true;
|
||||
setIgnoreCredentialFailure(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ void OwncloudPropagator::start(const SyncFileItemVector& items)
|
||||
connect(_rootJob.data(), SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)),
|
||||
this, SIGNAL(itemCompleted(const SyncFileItem &, const PropagatorJob &)));
|
||||
connect(_rootJob.data(), SIGNAL(progress(const SyncFileItem &,quint64)), this, SIGNAL(progress(const SyncFileItem &,quint64)));
|
||||
connect(_rootJob.data(), SIGNAL(finished(SyncFileItem::Status)), this, SLOT(emitFinished()));
|
||||
connect(_rootJob.data(), SIGNAL(finished(SyncFileItem::Status)), this, SLOT(emitFinished(SyncFileItem::Status)));
|
||||
connect(_rootJob.data(), SIGNAL(ready()), this, SLOT(scheduleNextJob()), Qt::QueuedConnection);
|
||||
|
||||
qDebug() << "Using QNAM/HTTP parallel code path";
|
||||
@@ -542,27 +542,6 @@ void OwncloudPropagator::scheduleNextJob()
|
||||
}
|
||||
}
|
||||
|
||||
void OwncloudPropagator::addTouchedFile(const QString& fn)
|
||||
{
|
||||
QString file = QDir::cleanPath(fn);
|
||||
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
||||
QMutexLocker lock(&_touchedFilesMutex);
|
||||
_touchedFiles.insert(file, timer);
|
||||
}
|
||||
|
||||
qint64 OwncloudPropagator::timeSinceFileTouched(const QString& fn) const
|
||||
{
|
||||
QMutexLocker lock(&_touchedFilesMutex);
|
||||
if (! _touchedFiles.contains(fn)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return _touchedFiles[fn].elapsed();
|
||||
}
|
||||
|
||||
AccountPtr OwncloudPropagator::account() const
|
||||
{
|
||||
return _account;
|
||||
@@ -762,6 +741,7 @@ void CleanupPollsJob::slotPollFinished()
|
||||
Q_ASSERT(job);
|
||||
if (job->_item->_status == SyncFileItem::FatalError) {
|
||||
emit aborted(job->_item->_errorString);
|
||||
deleteLater();
|
||||
return;
|
||||
} else if (job->_item->_status != SyncFileItem::Success) {
|
||||
qDebug() << "There was an error with file " << job->_item->_file << job->_item->_errorString;
|
||||
@@ -771,6 +751,7 @@ void CleanupPollsJob::slotPollFinished()
|
||||
job->_item->_status = SyncFileItem::FatalError;
|
||||
job->_item->_errorString = tr("Error writing metadata to the database");
|
||||
emit aborted(job->_item->_errorString);
|
||||
deleteLater();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
if (_rootJob) {
|
||||
_rootJob->abort();
|
||||
}
|
||||
emitFinished();
|
||||
emitFinished(SyncFileItem::NormalError);
|
||||
}
|
||||
|
||||
// timeout in seconds
|
||||
@@ -330,18 +330,6 @@ public:
|
||||
/** returns the size of chunks in bytes */
|
||||
static quint64 chunkSize();
|
||||
|
||||
/** Records that a file was touched by a job.
|
||||
*
|
||||
* Thread-safe.
|
||||
*/
|
||||
void addTouchedFile(const QString& fn);
|
||||
|
||||
/** Get the ms since a file was touched, or -1 if it wasn't.
|
||||
*
|
||||
* Thread-safe.
|
||||
*/
|
||||
qint64 timeSinceFileTouched(const QString& fn) const;
|
||||
|
||||
AccountPtr account() const;
|
||||
|
||||
enum DiskSpaceResult
|
||||
@@ -361,9 +349,9 @@ public:
|
||||
private slots:
|
||||
|
||||
/** Emit the finished signal and make sure it is only emitted once */
|
||||
void emitFinished() {
|
||||
void emitFinished(SyncFileItem::Status status) {
|
||||
if (!_finishedEmited)
|
||||
emit finished();
|
||||
emit finished(status == SyncFileItem::Success);
|
||||
_finishedEmited = true;
|
||||
}
|
||||
|
||||
@@ -372,23 +360,29 @@ private slots:
|
||||
signals:
|
||||
void itemCompleted(const SyncFileItem &, const PropagatorJob &);
|
||||
void progress(const SyncFileItem&, quint64 bytes);
|
||||
void finished();
|
||||
void finished(bool success);
|
||||
|
||||
/** Emitted when propagation has problems with a locked file. */
|
||||
void seenLockedFile(const QString &fileName);
|
||||
|
||||
/** Emitted when propagation touches a file.
|
||||
*
|
||||
* Used to track our own file modifications such that notifications
|
||||
* from the file watcher about these can be ignored.
|
||||
*/
|
||||
void touchedFile(const QString &fileName);
|
||||
|
||||
private:
|
||||
|
||||
AccountPtr _account;
|
||||
|
||||
/** Stores the time since a job touched a file. */
|
||||
QHash<QString, QElapsedTimer> _touchedFiles;
|
||||
mutable QMutex _touchedFilesMutex;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
// access to signals which are protected in Qt4
|
||||
friend class PropagateDownloadFileQNAM;
|
||||
friend class PropagateUploadFileQNAM;
|
||||
friend class PropagateLocalMkdir;
|
||||
friend class PropagateLocalRename;
|
||||
friend class PropagateRemoteMove;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -410,6 +404,10 @@ public:
|
||||
|
||||
~CleanupPollsJob();
|
||||
|
||||
/**
|
||||
* Start the job. After the job is completed, it will emit either finished or aborted, and it
|
||||
* will destroy itself.
|
||||
*/
|
||||
void start();
|
||||
signals:
|
||||
void finished();
|
||||
|
||||
@@ -47,7 +47,7 @@ QString ownCloudTheme::about() const
|
||||
devString = trUtf8("<p>Version %2. For more information visit <a href=\"%3\">%4</a></p>"
|
||||
"<p><small>By Klaas Freitag, Daniel Molkentin, Jan-Christoph Borchardt, "
|
||||
"Olivier Goffart, Markus Götz and others.</small></p>"
|
||||
"<p>Copyright ownCloud, Inc.</p>"
|
||||
"<p>Copyright ownCloud GmbH</p>"
|
||||
"<p>Licensed under the GNU General Public License (GPL) Version 2.0<br/>"
|
||||
"ownCloud and the ownCloud Logo are registered trademarks of ownCloud, "
|
||||
"Inc. in the United States, other countries, or both.</p>"
|
||||
@@ -72,21 +72,6 @@ QIcon ownCloudTheme::applicationIcon( ) const
|
||||
{
|
||||
return themeIcon( QLatin1String("owncloud-icon") );
|
||||
}
|
||||
|
||||
|
||||
QVariant ownCloudTheme::customMedia(Theme::CustomMediaType type)
|
||||
{
|
||||
if (type == Theme::oCSetupTop) {
|
||||
// return QCoreApplication::translate("ownCloudTheme",
|
||||
// "If you don't have an ownCloud server yet, "
|
||||
// "see <a href=\"https://owncloud.com\">owncloud.com</a> for more info.",
|
||||
// "Top text in setup wizard. Keep short!");
|
||||
return QVariant();
|
||||
} else {
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
QString ownCloudTheme::helpUrl() const
|
||||
|
||||
@@ -41,8 +41,6 @@ public:
|
||||
|
||||
QString helpUrl() const Q_DECL_OVERRIDE;
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QVariant customMedia(CustomMediaType type) Q_DECL_OVERRIDE;
|
||||
|
||||
QColor wizardHeaderBackgroundColor() const Q_DECL_OVERRIDE;
|
||||
QColor wizardHeaderTitleColor() const Q_DECL_OVERRIDE;
|
||||
QPixmap wizardHeaderLogo() const Q_DECL_OVERRIDE;
|
||||
|
||||
@@ -303,6 +303,11 @@ void SqlQuery::bindValue(int pos, const QVariant& value)
|
||||
res = sqlite3_bind_null(_stmt, pos);
|
||||
}
|
||||
break; }
|
||||
case QVariant::ByteArray: {
|
||||
auto ba = value.toByteArray();
|
||||
res = sqlite3_bind_text(_stmt, pos, ba.constData(), ba.size(), SQLITE_TRANSIENT);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
QString str = value.toString();
|
||||
// SQLITE_TRANSIENT makes sure that sqlite buffers the data
|
||||
@@ -312,7 +317,7 @@ void SqlQuery::bindValue(int pos, const QVariant& value)
|
||||
}
|
||||
}
|
||||
if (res != SQLITE_OK) {
|
||||
qDebug() << Q_FUNC_INFO << "ERROR" << value.toString() << res;
|
||||
qDebug() << Q_FUNC_INFO << "ERROR" << value << res;
|
||||
}
|
||||
Q_ASSERT( res == SQLITE_OK );
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ void GETFileJob::start() {
|
||||
} else {
|
||||
// Use direct URL
|
||||
setReply(davRequest("GET", _directDownloadUrl, req));
|
||||
_followRedirects = true; // (follow redirections for the direct download)
|
||||
}
|
||||
setupConnections(reply());
|
||||
|
||||
@@ -592,8 +591,8 @@ void PropagateDownloadFileQNAM::deleteExistingFolder()
|
||||
QString conflictDir = FileSystem::makeConflictFileName(
|
||||
existingDir, Utility::qDateTimeFromTime_t(_item->_modtime));
|
||||
|
||||
_propagator->addTouchedFile(existingDir);
|
||||
_propagator->addTouchedFile(conflictDir);
|
||||
emit _propagator->touchedFile(existingDir);
|
||||
emit _propagator->touchedFile(conflictDir);
|
||||
QString renameError;
|
||||
if (!FileSystem::rename(existingDir, conflictDir, &renameError)) {
|
||||
done(SyncFileItem::NormalError, renameError);
|
||||
@@ -753,7 +752,7 @@ void PropagateDownloadFileQNAM::downloadFinished()
|
||||
}
|
||||
|
||||
QString error;
|
||||
_propagator->addTouchedFile(fn);
|
||||
emit _propagator->touchedFile(fn);
|
||||
// The fileChanged() check is done above to generate better error messages.
|
||||
if (!FileSystem::uncheckedRenameReplace(_tmpFile.fileName(), fn, &error)) {
|
||||
qDebug() << Q_FUNC_INFO << QString("Rename failed: %1 => %2").arg(_tmpFile.fileName()).arg(fn);
|
||||
|
||||
@@ -80,8 +80,8 @@ void PropagateRemoteMove::start()
|
||||
QString versionString = _propagator->account()->serverVersion();
|
||||
if (versionString.contains('.') && versionString.split('.')[0].toInt() < 7) {
|
||||
QString originalFile(_propagator->getFilePath(QLatin1String("Shared")));
|
||||
_propagator->addTouchedFile(originalFile);
|
||||
_propagator->addTouchedFile(targetFile);
|
||||
emit _propagator->touchedFile(originalFile);
|
||||
emit _propagator->touchedFile(targetFile);
|
||||
QString renameError;
|
||||
if( FileSystem::rename(targetFile, originalFile, &renameError) ) {
|
||||
done(SyncFileItem::NormalError, tr("This folder must not be renamed. It is renamed back to its original name."));
|
||||
|
||||
@@ -163,7 +163,7 @@ void PropagateLocalMkdir::start()
|
||||
done( SyncFileItem::NormalError, tr("Attention, possible case sensitivity clash with %1").arg(newDirStr) );
|
||||
return;
|
||||
}
|
||||
_propagator->addTouchedFile(newDirStr);
|
||||
emit _propagator->touchedFile(newDirStr);
|
||||
QDir localDir(_propagator->_localDir);
|
||||
if (!localDir.mkpath(_item->_file)) {
|
||||
done( SyncFileItem::NormalError, tr("could not create folder %1").arg(newDirStr) );
|
||||
@@ -217,8 +217,8 @@ void PropagateLocalRename::start()
|
||||
return;
|
||||
}
|
||||
|
||||
_propagator->addTouchedFile(existingFile);
|
||||
_propagator->addTouchedFile(targetFile);
|
||||
emit _propagator->touchedFile(existingFile);
|
||||
emit _propagator->touchedFile(targetFile);
|
||||
QString renameError;
|
||||
if (!FileSystem::rename(existingFile, targetFile, &renameError)) {
|
||||
done(SyncFileItem::NormalError, renameError);
|
||||
|
||||
@@ -95,6 +95,10 @@ SyncEngine::SyncEngine(AccountPtr account, const QString& localPath,
|
||||
_excludedFiles.reset(new ExcludedFiles(&_csync_ctx->excludes));
|
||||
_syncFileStatusTracker.reset(new SyncFileStatusTracker(this));
|
||||
|
||||
_clearTouchedFilesTimer.setSingleShot(true);
|
||||
_clearTouchedFilesTimer.setInterval(30*1000);
|
||||
connect(&_clearTouchedFilesTimer, SIGNAL(timeout()), SLOT(slotClearTouchedFiles()));
|
||||
|
||||
_thread.setObjectName("SyncEngine_Thread");
|
||||
}
|
||||
|
||||
@@ -433,6 +437,9 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
|
||||
case CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS:
|
||||
item->_errorString = tr("Filename contains invalid characters that can not be synced cross platform.");
|
||||
break;
|
||||
case CSYNC_STATUS_INDIVIDUAL_TRAILING_SPACE:
|
||||
item->_errorString = tr("Filename contains trailing spaces.");
|
||||
break;
|
||||
case CSYNC_STATUS_INDIVIDUAL_EXCLUDE_LONG_FILENAME:
|
||||
item->_errorString = tr("Filename is too long.");
|
||||
break;
|
||||
@@ -681,6 +688,7 @@ void SyncEngine::startSync()
|
||||
s_anySyncRunning = true;
|
||||
_syncRunning = true;
|
||||
_anotherSyncNeeded = false;
|
||||
_clearTouchedFilesTimer.stop();
|
||||
|
||||
_progressInfo->reset();
|
||||
|
||||
@@ -717,16 +725,19 @@ void SyncEngine::startSync()
|
||||
|
||||
int fileRecordCount = -1;
|
||||
if (!_journal->exists()) {
|
||||
qDebug() << "=====sync looks new (no DB exists)";
|
||||
qDebug() << "===== new sync (no sync journal exists)";
|
||||
} else {
|
||||
qDebug() << "=====sync with existing DB";
|
||||
qDebug() << "===== sync with existing sync journal";
|
||||
}
|
||||
|
||||
qDebug() << "=====Using Qt" << qVersion();
|
||||
QString verStr("===== Using Qt ");
|
||||
verStr.append( qVersion() );
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
qDebug() << "=====Using SSL library version"
|
||||
<< QSslSocket::sslLibraryVersionString().toUtf8().data();
|
||||
verStr.append( " SSL library " ).append(QSslSocket::sslLibraryVersionString().toUtf8().data());
|
||||
#endif
|
||||
verStr.append( " on ").append(Utility::platformName());
|
||||
qDebug() << verStr;
|
||||
|
||||
fileRecordCount = _journal->getFileRecordCount(); // this creates the DB if it does not exist yet
|
||||
|
||||
@@ -765,7 +776,11 @@ void SyncEngine::startSync()
|
||||
|
||||
qDebug() << "#### Discovery start #################################################### >>";
|
||||
|
||||
_thread.start();
|
||||
// Usually the discovery runs in the background: We want to avoid
|
||||
// stealing too much time from other processes that the user might
|
||||
// be interacting with at the time.
|
||||
_thread.start(QThread::LowPriority);
|
||||
|
||||
_discoveryMainThread = new DiscoveryMainThread(account());
|
||||
_discoveryMainThread->setParent(this);
|
||||
connect(this, SIGNAL(finished(bool)), _discoveryMainThread, SLOT(deleteLater()));
|
||||
@@ -900,7 +915,16 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!_hasForwardInTimeFiles && _backInTimeFiles >= 2) {
|
||||
|
||||
auto databaseFingerprint = _journal->dataFingerprint();
|
||||
// If databaseFingerprint is null, this means that there was no information in the database
|
||||
// (for example, upgrading from a previous version, or first sync)
|
||||
// Note that an empty ("") fingerprint is valid and means it was empty on the server before.
|
||||
if (!databaseFingerprint.isNull()
|
||||
&& _discoveryMainThread->_dataFingerprint != databaseFingerprint) {
|
||||
qDebug() << "data fingerprint changed, assume restore from backup" << databaseFingerprint << _discoveryMainThread->_dataFingerprint;
|
||||
restoreOldFiles();
|
||||
} else if (!_hasForwardInTimeFiles && _backInTimeFiles >= 2) {
|
||||
qDebug() << "All the changes are bringing files in the past, asking the user";
|
||||
// this typically happen when a backup is restored on the server
|
||||
bool restore = false;
|
||||
@@ -943,8 +967,9 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult)
|
||||
this, SLOT(slotItemCompleted(const SyncFileItem &, const PropagatorJob &)));
|
||||
connect(_propagator.data(), SIGNAL(progress(const SyncFileItem &,quint64)),
|
||||
this, SLOT(slotProgress(const SyncFileItem &,quint64)));
|
||||
connect(_propagator.data(), SIGNAL(finished()), this, SLOT(slotFinished()), Qt::QueuedConnection);
|
||||
connect(_propagator.data(), SIGNAL(finished(bool)), this, SLOT(slotFinished(bool)), Qt::QueuedConnection);
|
||||
connect(_propagator.data(), SIGNAL(seenLockedFile(QString)), SIGNAL(seenLockedFile(QString)));
|
||||
connect(_propagator.data(), SIGNAL(touchedFile(QString)), SLOT(slotAddTouchedFile(QString)));
|
||||
|
||||
// apply the network limits to the propagator
|
||||
setNetworkLimits(_uploadLimit, _downloadLimit);
|
||||
@@ -1010,10 +1035,14 @@ void SyncEngine::slotItemCompleted(const SyncFileItem &item, const PropagatorJob
|
||||
emit itemCompleted(item, job);
|
||||
}
|
||||
|
||||
void SyncEngine::slotFinished()
|
||||
void SyncEngine::slotFinished(bool success)
|
||||
{
|
||||
_anotherSyncNeeded = _anotherSyncNeeded || _propagator->_anotherSyncNeeded;
|
||||
|
||||
if (success) {
|
||||
_journal->setDataFingerprint(_discoveryMainThread->_dataFingerprint);
|
||||
}
|
||||
|
||||
// emit the treewalk results.
|
||||
if( ! _journal->postSyncCleanup( _seenFiles, _temporarilyUnavailablePaths ) ) {
|
||||
qDebug() << "Cleaning of synced ";
|
||||
@@ -1021,7 +1050,7 @@ void SyncEngine::slotFinished()
|
||||
|
||||
_journal->commit("All Finished.", false);
|
||||
emit treeWalkResult(_syncedItems);
|
||||
finalize(true); // FIXME: should it be true if there was errors?
|
||||
finalize(success);
|
||||
}
|
||||
|
||||
void SyncEngine::finalize(bool success)
|
||||
@@ -1041,6 +1070,8 @@ void SyncEngine::finalize(bool success)
|
||||
|
||||
// Delete the propagator only after emitting the signal.
|
||||
_propagator.clear();
|
||||
|
||||
_clearTouchedFilesTimer.start();
|
||||
}
|
||||
|
||||
void SyncEngine::slotProgress(const SyncFileItem& item, quint64 current)
|
||||
@@ -1362,14 +1393,28 @@ SyncFileItem* SyncEngine::findSyncItem(const QString &fileName) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SyncEngine::slotAddTouchedFile(const QString& fn)
|
||||
{
|
||||
QString file = QDir::cleanPath(fn);
|
||||
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
||||
_touchedFiles.insert(file, timer);
|
||||
}
|
||||
|
||||
void SyncEngine::slotClearTouchedFiles()
|
||||
{
|
||||
_touchedFiles.clear();
|
||||
}
|
||||
|
||||
qint64 SyncEngine::timeSinceFileTouched(const QString& fn) const
|
||||
{
|
||||
// This copy is essential for thread safety.
|
||||
QSharedPointer<OwncloudPropagator> prop = _propagator;
|
||||
if (prop) {
|
||||
return prop->timeSinceFileTouched(fn);
|
||||
if (! _touchedFiles.contains(fn)) {
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
|
||||
return _touchedFiles[fn].elapsed();
|
||||
}
|
||||
|
||||
AccountPtr SyncEngine::account() const
|
||||
|
||||
@@ -152,11 +152,17 @@ signals:
|
||||
private slots:
|
||||
void slotRootEtagReceived(const QString &);
|
||||
void slotItemCompleted(const SyncFileItem& item, const PropagatorJob & job);
|
||||
void slotFinished();
|
||||
void slotFinished(bool success);
|
||||
void slotProgress(const SyncFileItem& item, quint64 curent);
|
||||
void slotDiscoveryJobFinished(int updateResult);
|
||||
void slotCleanPollsJobAborted(const QString &error);
|
||||
|
||||
/** Records that a file was touched by a job. */
|
||||
void slotAddTouchedFile(const QString& fn);
|
||||
|
||||
/** Wipes the _touchedFiles hash */
|
||||
void slotClearTouchedFiles();
|
||||
|
||||
private:
|
||||
void handleSyncError(CSYNC *ctx, const char *state);
|
||||
|
||||
@@ -256,6 +262,12 @@ private:
|
||||
CSyncChecksumHook _checksum_hook;
|
||||
|
||||
bool _anotherSyncNeeded;
|
||||
|
||||
/** Stores the time since a job touched a file. */
|
||||
QHash<QString, QElapsedTimer> _touchedFiles;
|
||||
|
||||
/** For clearing the _touchedFiles variable after sync finished */
|
||||
QTimer _clearTouchedFilesTimer;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -93,11 +93,9 @@ SyncFileItem SyncFileStatusTracker::rootSyncFileItem()
|
||||
|
||||
SyncFileStatus SyncFileStatusTracker::fileStatus(const QString& relativePath)
|
||||
{
|
||||
// normalization is required for OS X to match file names properly
|
||||
QString normalizedRelativePath = relativePath.normalized(QString::NormalizationForm_C);
|
||||
Q_ASSERT(!normalizedRelativePath.endsWith(QLatin1Char('/')));
|
||||
Q_ASSERT(!relativePath.endsWith(QLatin1Char('/')));
|
||||
|
||||
if (normalizedRelativePath.isEmpty()) {
|
||||
if (relativePath.isEmpty()) {
|
||||
// This is the root sync folder, it doesn't have an entry in the database and won't be walked by csync, so create one manually.
|
||||
return syncFileItemStatus(rootSyncFileItem());
|
||||
}
|
||||
@@ -108,22 +106,22 @@ SyncFileStatus SyncFileStatusTracker::fileStatus(const QString& relativePath)
|
||||
// update the exclude list at runtime and doing it statically here removes
|
||||
// our ability to notify changes through the fileStatusChanged signal,
|
||||
// it's an acceptable compromize to treat all exclude types the same.
|
||||
if( _syncEngine->excludedFiles().isExcluded(_syncEngine->localPath() + normalizedRelativePath,
|
||||
if( _syncEngine->excludedFiles().isExcluded(_syncEngine->localPath() + relativePath,
|
||||
_syncEngine->localPath(),
|
||||
_syncEngine->ignoreHiddenFiles()) ) {
|
||||
return SyncFileStatus(SyncFileStatus::StatusWarning);
|
||||
}
|
||||
|
||||
if ( _dirtyPaths.contains(normalizedRelativePath) )
|
||||
if ( _dirtyPaths.contains(relativePath) )
|
||||
return SyncFileStatus::StatusSync;
|
||||
|
||||
SyncFileItem* item = _syncEngine->findSyncItem(normalizedRelativePath);
|
||||
SyncFileItem* item = _syncEngine->findSyncItem(relativePath);
|
||||
if (item) {
|
||||
return syncFileItemStatus(*item);
|
||||
}
|
||||
|
||||
// If we're not currently syncing that file, look it up in the database to know if it's shared
|
||||
SyncJournalFileRecord rec = _syncEngine->journal()->getFileRecord(normalizedRelativePath);
|
||||
SyncJournalFileRecord rec = _syncEngine->journal()->getFileRecord(relativePath);
|
||||
if (rec.isValid()) {
|
||||
return syncFileItemStatus(rec.toSyncFileItem());
|
||||
}
|
||||
@@ -164,7 +162,7 @@ void SyncFileStatusTracker::slotAboutToPropagate(SyncFileItemVector& items)
|
||||
// Swap into a copy since fileStatus() reads _dirtyPaths to determine the status
|
||||
QSet<QString> oldDirtyPaths;
|
||||
std::swap(_dirtyPaths, oldDirtyPaths);
|
||||
for (auto it = oldDirtyPaths.begin(); it != oldDirtyPaths.end(); ++it)
|
||||
for (auto it = oldDirtyPaths.constBegin(); it != oldDirtyPaths.constEnd(); ++it)
|
||||
emit fileStatusChanged(getSystemDestination(*it), fileStatus(*it));
|
||||
|
||||
// Make sure to push any status that might have been resolved indirectly since the last sync
|
||||
|
||||
@@ -286,6 +286,13 @@ bool SyncJournalDb::checkConnect()
|
||||
return sqlFail("Create table version", createQuery);
|
||||
}
|
||||
|
||||
// create the checksumtype table.
|
||||
createQuery.prepare("CREATE TABLE IF NOT EXISTS datafingerprint("
|
||||
"fingerprint TEXT UNIQUE"
|
||||
");");
|
||||
if (!createQuery.exec()) {
|
||||
return sqlFail("Create table datafingerprint", createQuery);
|
||||
}
|
||||
|
||||
createQuery.prepare("CREATE TABLE IF NOT EXISTS version("
|
||||
"major INTEGER(8),"
|
||||
@@ -436,6 +443,14 @@ bool SyncJournalDb::checkConnect()
|
||||
_insertChecksumTypeQuery.reset(new SqlQuery(_db));
|
||||
_insertChecksumTypeQuery->prepare("INSERT OR IGNORE INTO checksumtype (name) VALUES (?1)");
|
||||
|
||||
_getDataFingerprintQuery.reset(new SqlQuery(_db));
|
||||
_getDataFingerprintQuery->prepare("SELECT fingerprint FROM datafingerprint");
|
||||
|
||||
_setDataFingerprintQuery1.reset(new SqlQuery(_db));
|
||||
_setDataFingerprintQuery1->prepare("DELETE FROM datafingerprint;");
|
||||
_setDataFingerprintQuery2.reset(new SqlQuery(_db));
|
||||
_setDataFingerprintQuery2->prepare("INSERT INTO datafingerprint (fingerprint) VALUES (?1);");
|
||||
|
||||
// don't start a new transaction now
|
||||
commitInternal(QString("checkConnect End"), false);
|
||||
|
||||
@@ -472,6 +487,9 @@ void SyncJournalDb::close()
|
||||
_getChecksumTypeIdQuery.reset(0);
|
||||
_getChecksumTypeQuery.reset(0);
|
||||
_insertChecksumTypeQuery.reset(0);
|
||||
_getDataFingerprintQuery.reset(0);
|
||||
_setDataFingerprintQuery1.reset(0);
|
||||
_setDataFingerprintQuery2.reset(0);
|
||||
|
||||
_db.close();
|
||||
_avoidReadFromDbOnNextSyncFilter.clear();
|
||||
@@ -1602,6 +1620,49 @@ int SyncJournalDb::mapChecksumType(const QByteArray& checksumType)
|
||||
return _getChecksumTypeIdQuery->intValue(0);
|
||||
}
|
||||
|
||||
QByteArray SyncJournalDb::dataFingerprint()
|
||||
{
|
||||
QMutexLocker locker(&_mutex);
|
||||
if (!checkConnect()) {
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
_getDataFingerprintQuery->reset_and_clear_bindings();
|
||||
if (!_getDataFingerprintQuery->exec()) {
|
||||
qWarning() << "Error SQL statement dataFingerprint: "
|
||||
<< _getDataFingerprintQuery->lastQuery() << " :"
|
||||
<< _getDataFingerprintQuery->error();
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
if (!_getDataFingerprintQuery->next()) {
|
||||
return QByteArray();
|
||||
}
|
||||
return _getDataFingerprintQuery->baValue(0);
|
||||
}
|
||||
|
||||
void SyncJournalDb::setDataFingerprint(const QByteArray &dataFingerprint)
|
||||
{
|
||||
QMutexLocker locker(&_mutex);
|
||||
if (!checkConnect()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_setDataFingerprintQuery1->reset_and_clear_bindings();
|
||||
if (!_setDataFingerprintQuery1->exec()) {
|
||||
qWarning() << "Error SQL statement setDataFingerprint1: "
|
||||
<< _setDataFingerprintQuery1->lastQuery() << " :"
|
||||
<< _setDataFingerprintQuery1->error();
|
||||
}
|
||||
|
||||
_setDataFingerprintQuery2->reset_and_clear_bindings();
|
||||
_setDataFingerprintQuery2->bindValue(1, dataFingerprint);
|
||||
if (!_setDataFingerprintQuery2->exec()) {
|
||||
qWarning() << "Error SQL statement setDataFingerprint2: "
|
||||
<< _setDataFingerprintQuery2->lastQuery() << " :"
|
||||
<< _setDataFingerprintQuery2->error();
|
||||
}
|
||||
}
|
||||
|
||||
void SyncJournalDb::commit(const QString& context, bool startTrans)
|
||||
{
|
||||
|
||||
@@ -154,6 +154,12 @@ public:
|
||||
*/
|
||||
QByteArray getChecksumType(int checksumTypeId);
|
||||
|
||||
/**
|
||||
* The data-fingerprint used to detect backup
|
||||
*/
|
||||
void setDataFingerprint(const QByteArray &dataFingerprint);
|
||||
QByteArray dataFingerprint();
|
||||
|
||||
private:
|
||||
bool updateDatabaseStructure();
|
||||
bool updateMetadataTableStructure();
|
||||
@@ -196,6 +202,9 @@ private:
|
||||
QScopedPointer<SqlQuery> _getChecksumTypeIdQuery;
|
||||
QScopedPointer<SqlQuery> _getChecksumTypeQuery;
|
||||
QScopedPointer<SqlQuery> _insertChecksumTypeQuery;
|
||||
QScopedPointer<SqlQuery> _getDataFingerprintQuery;
|
||||
QScopedPointer<SqlQuery> _setDataFingerprintQuery1;
|
||||
QScopedPointer<SqlQuery> _setDataFingerprintQuery2;
|
||||
|
||||
/* This is the list of paths we called avoidReadFromDbOnNextSync on.
|
||||
* It means that they should not be written to the DB in any case since doing
|
||||
|
||||
+1
-37
@@ -286,7 +286,7 @@ QString Theme::about() const
|
||||
.arg(MIRALL_VERSION_STRING).arg("http://" MIRALL_STRINGIFY(APPLICATION_DOMAIN))
|
||||
.arg(MIRALL_STRINGIFY(APPLICATION_DOMAIN));
|
||||
|
||||
re += tr("<p>Copyright ownCloud, Incorporated</p>");
|
||||
re += tr("<p>Copyright ownCloud GmbH</p>");
|
||||
re += tr("<p>Distributed by %1 and licensed under the GNU General Public License (GPL) Version 2.0.<br/>"
|
||||
"%2 and the %2 logo are registered trademarks of %1 in the "
|
||||
"United States, other countries, or both.</p>")
|
||||
@@ -296,41 +296,6 @@ QString Theme::about() const
|
||||
return re;
|
||||
}
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
QVariant Theme::customMedia( CustomMediaType type )
|
||||
{
|
||||
QVariant re;
|
||||
QString key;
|
||||
|
||||
switch ( type )
|
||||
{
|
||||
case oCSetupTop:
|
||||
key = QLatin1String("oCSetupTop");
|
||||
break;
|
||||
case oCSetupSide:
|
||||
key = QLatin1String("oCSetupSide");
|
||||
break;
|
||||
case oCSetupBottom:
|
||||
key = QLatin1String("oCSetupBottom");
|
||||
break;
|
||||
case oCSetupResultTop:
|
||||
key = QLatin1String("oCSetupResultTop");
|
||||
break;
|
||||
}
|
||||
|
||||
QString imgPath = QString::fromLatin1(":/client/theme/colored/%1.png").arg(key);
|
||||
if ( QFile::exists( imgPath ) ) {
|
||||
QPixmap pix( imgPath );
|
||||
if( pix.isNull() ) {
|
||||
// pixmap loading hasn't succeeded. We take the text instead.
|
||||
re.setValue( key );
|
||||
} else {
|
||||
re.setValue( pix );
|
||||
}
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
||||
QIcon Theme::syncStateIcon( SyncResult::Status status, bool sysTray ) const
|
||||
{
|
||||
// FIXME: Mind the size!
|
||||
@@ -401,7 +366,6 @@ QPixmap Theme::wizardHeaderBanner() const
|
||||
pix.fill(wizardHeaderBackgroundColor());
|
||||
return pix;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Theme::wizardSelectiveSyncDefaultNothing() const
|
||||
{
|
||||
|
||||
@@ -37,13 +37,6 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum CustomMediaType {
|
||||
oCSetupTop, // ownCloud connect page
|
||||
oCSetupSide,
|
||||
oCSetupBottom,
|
||||
oCSetupResultTop // ownCloud connect result page
|
||||
};
|
||||
|
||||
/* returns a singleton instance. */
|
||||
static Theme* instance();
|
||||
|
||||
@@ -155,13 +148,6 @@ public:
|
||||
QString systrayIconFlavor(bool mono) const;
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
/**
|
||||
* Override to use a string or a custom image name.
|
||||
* The default implementation will try to look up
|
||||
* :/client/theme/<type>.png
|
||||
*/
|
||||
virtual QVariant customMedia( CustomMediaType type );
|
||||
|
||||
/** @return color for the setup wizard */
|
||||
virtual QColor wizardHeaderTitleColor() const;
|
||||
|
||||
|
||||
@@ -35,6 +35,13 @@
|
||||
#else
|
||||
#include <QStandardPaths>
|
||||
#endif
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
||||
#include <QCollator>
|
||||
#endif
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
||||
#include <QSysInfo>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <sys/statvfs.h>
|
||||
@@ -420,6 +427,25 @@ bool Utility::isBSD()
|
||||
#endif
|
||||
}
|
||||
|
||||
QString Utility::platformName()
|
||||
{
|
||||
QString re("Windows");
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
||||
if( isMac() ) {
|
||||
re = QLatin1String("MacOSX");
|
||||
} else if( isLinux() ) {
|
||||
re = QLatin1String("Linux");
|
||||
} else if( isBSD() ) {
|
||||
re = QLatin1String("BSD");
|
||||
} else if( isUnix() ) {
|
||||
re = QLatin1String("Unix");
|
||||
}
|
||||
#else
|
||||
re = QSysInfo::prettyProductName();
|
||||
#endif
|
||||
return re;
|
||||
}
|
||||
|
||||
void Utility::crash()
|
||||
{
|
||||
@@ -546,4 +572,18 @@ quint64 Utility::StopWatch::durationOfLap( const QString& lapName ) const
|
||||
return _lapTimes.value(lapName, 0);
|
||||
}
|
||||
|
||||
void Utility::sortFilenames(QStringList& fileNames)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
||||
QCollator collator;
|
||||
collator.setNumericMode(true);
|
||||
collator.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
qSort(fileNames.begin(), fileNames.end(), collator);
|
||||
#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
fileNames.sort(Qt::CaseInsensitive);
|
||||
#else
|
||||
fileNames.sort();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace OCC
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace Utility
|
||||
OWNCLOUDSYNC_EXPORT bool isLinux(); // use with care
|
||||
OWNCLOUDSYNC_EXPORT bool isBSD(); // use with care, does not match OS X
|
||||
|
||||
OWNCLOUDSYNC_EXPORT QString platformName();
|
||||
// crash helper for --debug
|
||||
OWNCLOUDSYNC_EXPORT void crash();
|
||||
|
||||
@@ -136,6 +137,11 @@ namespace Utility
|
||||
quint64 durationOfLap( const QString& lapName ) const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Sort a QStringList in a way that's appropriate for filenames
|
||||
*/
|
||||
OWNCLOUDSYNC_EXPORT void sortFilenames(QStringList& fileNames);
|
||||
|
||||
}
|
||||
/** @} */ // \addtogroup
|
||||
|
||||
|
||||
@@ -151,7 +151,13 @@ using namespace OCC;
|
||||
};
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
QTEST_MAIN(TestChecksumValidator)
|
||||
// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it.
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
TestChecksumValidator tc;
|
||||
return QTest::qExec(&tc, argc, argv);
|
||||
}
|
||||
#else
|
||||
QTEST_GUILESS_MAIN(TestChecksumValidator)
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,6 @@ private slots:
|
||||
bool excludeHidden = true;
|
||||
bool keepHidden = false;
|
||||
|
||||
bool x = excluded.isExcluded("/a/b", "/a", keepHidden);
|
||||
QVERIFY(!excluded.isExcluded("/a/b", "/a", keepHidden));
|
||||
QVERIFY(!excluded.isExcluded("/a/b~", "/a", keepHidden));
|
||||
QVERIFY(!excluded.isExcluded("/a/.b", "/a", keepHidden));
|
||||
|
||||
@@ -171,7 +171,13 @@ private slots:
|
||||
};
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
QTEST_MAIN(TestFolderWatcher)
|
||||
// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it.
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
TestFolderWatcher tc;
|
||||
return QTest::qExec(&tc, argc, argv);
|
||||
}
|
||||
#else
|
||||
QTEST_GUILESS_MAIN(TestFolderWatcher)
|
||||
#endif
|
||||
|
||||
@@ -442,7 +442,13 @@ private slots:
|
||||
};
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
QTEST_MAIN(TestXmlParse)
|
||||
// Qt4 does not have QTEST_GUILESS_MAIN, so we simulate it.
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
TestXmlParse tc;
|
||||
return QTest::qExec(&tc, argc, argv);
|
||||
}
|
||||
#else
|
||||
QTEST_GUILESS_MAIN(TestXmlParse)
|
||||
#endif
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário