summaryrefslogtreecommitdiff
path: root/RealtimeSync
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:22:55 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:22:55 +0200
commitc4182431ac7d9d306fdd2267e082fa4cec6fec2c (patch)
tree865cca543c062b7af2586f85cee19f9af4e7614d /RealtimeSync
parent5.11 (diff)
downloadFreeFileSync-c4182431ac7d9d306fdd2267e082fa4cec6fec2c.tar.gz
FreeFileSync-c4182431ac7d9d306fdd2267e082fa4cec6fec2c.tar.bz2
FreeFileSync-c4182431ac7d9d306fdd2267e082fa4cec6fec2c.zip
5.12
Diffstat (limited to 'RealtimeSync')
-rw-r--r--RealtimeSync/RealtimeSync.cbp158
-rw-r--r--RealtimeSync/resources.cpp4
-rw-r--r--RealtimeSync/tray_menu.cpp2
-rw-r--r--RealtimeSync/watcher.cpp13
4 files changed, 10 insertions, 167 deletions
diff --git a/RealtimeSync/RealtimeSync.cbp b/RealtimeSync/RealtimeSync.cbp
deleted file mode 100644
index a5f82367..00000000
--- a/RealtimeSync/RealtimeSync.cbp
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<CodeBlocks_project_file>
- <FileVersion major="1" minor="6" />
- <Project>
- <Option title="RealtimeSync" />
- <Option makefile="makefile" />
- <Option pch_mode="2" />
- <Option compiler="gcc" />
- <Build>
- <Target title="Release">
- <Option output="../BUILD/Bin/RealtimeSync_Win32" prefix_auto="1" extension_auto="1" />
- <Option working_dir="../BUILD" />
- <Option object_output="../OBJ/RTS_Release_32_MinGW" />
- <Option type="0" />
- <Option compiler="gcc" />
- <Option projectLinkerOptionsRelation="2" />
- <Compiler>
- <Add option="-O3" />
- <Add option="-DNDEBUG" />
- <Add directory="C:/Programme/C++/wxWidgets/lib/mingw_release_lib/mswu" />
- </Compiler>
- <Linker>
- <Add option="-s" />
- <Add option="-static" />
- <Add library="libwxmsw28u_core.a" />
- <Add library="libwxmsw28u_adv.a" />
- <Add library="libwxbase28u.a" />
- <Add library="libwxpng.a" />
- <Add library="libwxzlib.a" />
- <Add library="libboost_thread-mgw47-mt-s-1_52.a" />
- <Add library="libboost_system-mgw47-mt-s-1_52.a" />
- <Add directory="C:/Programme/C++/wxWidgets/lib/mingw_release_lib" />
- </Linker>
- <ExtraCommands>
- <Add after='&quot;C:\Program Files\C++\CodeSigning\SignCode.cmd&quot; &quot;$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)&quot;' />
- </ExtraCommands>
- </Target>
- <Target title="Debug-DLL">
- <Option output="../BUILD/Bin/RealtimeSync_Debug" prefix_auto="1" extension_auto="1" />
- <Option working_dir="../BUILD" />
- <Option object_output="../OBJ/RTS_Debug_32_MinGW" />
- <Option type="0" />
- <Option compiler="gcc" />
- <Option projectLinkerOptionsRelation="2" />
- <Compiler>
- <Add option="-g" />
- <Add option="-Winvalid-pch" />
- <Add option='-include &quot;../wx+/pch.h&quot;' />
- <Add option="-D__WXDEBUG__" />
- <Add directory="C:/Program Files/C++/wxWidgets/lib/mingw_debug_dll/mswud" />
- </Compiler>
- <Linker>
- <Add library="libwxmsw28ud_core.a" />
- <Add library="libwxmsw28ud_adv.a" />
- <Add library="libwxbase28ud.a" />
- <Add library="libwxpngd.a" />
- <Add library="libwxzlibd.a" />
- <Add library="libboost_thread-mgw47-mt-sd-1_52.a" />
- <Add library="libboost_system-mgw47-mt-sd-1_52.a" />
- <Add directory="C:/Program Files/C++/wxWidgets/lib/mingw_debug_dll" />
- </Linker>
- </Target>
- </Build>
- <Compiler>
- <Add option="-Wshadow" />
- <Add option="-Winit-self" />
- <Add option="-Wswitch-enum" />
- <Add option="-Wmain" />
- <Add option="-std=c++0x" />
- <Add option="-Wall" />
- <Add option="-pipe" />
- <Add option="-mthreads" />
- <Add option="-fno-omit-frame-pointer" />
- <Add option="-std=gnu++0x" />
- <Add option='-include &quot;../zen/warn_static.h&quot;' />
- <Add option="-D__GNUWIN32__" />
- <Add option="-D__WXMSW__" />
- <Add option="-DwxUSE_UNICODE" />
- <Add option="-DFFS_WIN" />
- <Add option="-DZEN_PLATFORM_WINDOWS" />
- <Add option="-DBOOST_THREAD_NO_LIB" />
- <Add option="-DBOOST_THREAD_USE_LIB" />
- <Add option="-DWXINTL_NO_GETTEXT_MACRO" />
- <Add directory="C:/Programme/C++/wxWidgets/include" />
- <Add directory="C:/Program Files/C++/Boost" />
- <Add directory=".." />
- </Compiler>
- <ResourceCompiler>
- <Add directory="C:/Programme/C++/wxWidgets/include" />
- </ResourceCompiler>
- <Linker>
- <Add option="-mthreads" />
- <Add library="libkernel32.a" />
- <Add library="libuser32.a" />
- <Add library="libuuid.a" />
- <Add library="libcomctl32.a" />
- <Add library="libgdi32.a" />
- <Add library="libole32.a" />
- <Add library="liboleaut32.a" />
- <Add library="libcomdlg32.a" />
- <Add library="libws2_32.a" />
- <Add library="libwinspool.a" />
- <Add library="libmpr.a" />
- <Add library="libuxtheme.a" />
- <Add directory="C:/Program Files/C++/Boost/stage/lib" />
- </Linker>
- <Unit filename="../lib/localization.cpp" />
- <Unit filename="../lib/process_xml.cpp" />
- <Unit filename="../lib/resolve_path.cpp" />
- <Unit filename="../lib/xml_base.cpp" />
- <Unit filename="../structures.cpp" />
- <Unit filename="../ui/dir_name.cpp" />
- <Unit filename="../ui/dir_name.h" />
- <Unit filename="../ui/folder_history_box.cpp" />
- <Unit filename="../ui/folder_history_box.h" />
- <Unit filename="../wx+/button.cpp" />
- <Unit filename="../wx+/mouse_move_dlg.cpp" />
- <Unit filename="../wx+/pch.h">
- <Option compile="1" />
- <Option weight="0" />
- <Option target="Debug-DLL" />
- </Unit>
- <Unit filename="../zen/dir_watcher.cpp" />
- <Unit filename="../zen/dst_hack.cpp" />
- <Unit filename="../zen/file_handling.cpp" />
- <Unit filename="../zen/file_io.cpp" />
- <Unit filename="../zen/file_traverser.cpp" />
- <Unit filename="../zen/notify_removal.cpp" />
- <Unit filename="../zen/privilege.cpp" />
- <Unit filename="../zen/scroll_window_under_cursor.cpp" />
- <Unit filename="../zen/zstring.cpp" />
- <Unit filename="WxWizFrame.fbp" />
- <Unit filename="application.cpp" />
- <Unit filename="application.h" />
- <Unit filename="gui_generated.cpp" />
- <Unit filename="gui_generated.h" />
- <Unit filename="main_dlg.cpp" />
- <Unit filename="main_dlg.h" />
- <Unit filename="resource.rc">
- <Option compilerVar="WINDRES" />
- </Unit>
- <Unit filename="resources.cpp" />
- <Unit filename="resources.h" />
- <Unit filename="tray_menu.cpp" />
- <Unit filename="tray_menu.h" />
- <Unit filename="watcher.cpp" />
- <Unit filename="watcher.h" />
- <Unit filename="xml_ffs.cpp" />
- <Unit filename="xml_ffs.h" />
- <Unit filename="xml_proc.cpp" />
- <Unit filename="xml_proc.h" />
- <Extensions>
- <code_completion />
- <envvars />
- <debugger />
- </Extensions>
- </Project>
-</CodeBlocks_project_file>
diff --git a/RealtimeSync/resources.cpp b/RealtimeSync/resources.cpp
index 391a1ddb..87bca60f 100644
--- a/RealtimeSync/resources.cpp
+++ b/RealtimeSync/resources.cpp
@@ -60,8 +60,8 @@ GlobalResources::GlobalResources()
const wxBitmap& GlobalResources::getImageInt(const wxString& name) const
{
auto it = bitmaps.find(!contains(name, L'.') ? //assume .png ending if nothing else specified
- name + L".png" :
- name);
+ name + L".png" :
+ name);
if (it != bitmaps.end())
return it->second;
else
diff --git a/RealtimeSync/tray_menu.cpp b/RealtimeSync/tray_menu.cpp
index 3319f427..eec568ad 100644
--- a/RealtimeSync/tray_menu.cpp
+++ b/RealtimeSync/tray_menu.cpp
@@ -401,7 +401,7 @@ rts::AbortReason rts::startDirectoryMonitor(const xmlAccess::XmlRealConfig& conf
lastChangeDetected = DirWatcher::Entry(); //make sure old name is not shown again after a directory reappears
//execute command
- auto cmdLineExp = utfCvrtTo<wxString>(expandMacros(utfCvrtTo<Zstring>(cmdLine)));
+ auto cmdLineExp = expandMacros(utfCvrtTo<Zstring>(cmdLine));
zen::shellExecute(cmdLineExp, zen::EXEC_TYPE_SYNC);
callback.clearSchedule();
}
diff --git a/RealtimeSync/watcher.cpp b/RealtimeSync/watcher.cpp
index 1380e474..9b1e5a17 100644
--- a/RealtimeSync/watcher.cpp
+++ b/RealtimeSync/watcher.cpp
@@ -72,7 +72,7 @@ rts::WaitResult rts::waitForChanges(const std::vector<Zstring>& dirNamesNonFmt,
{
//a non-existent network path may block, so check existence asynchronously!
auto ftDirExists = async([=] { return zen::dirExists(dirnameFmt); });
- while (!ftDirExists.timed_wait(boost::posix_time::milliseconds(UI_UPDATE_INTERVAL)))
+ while (!ftDirExists.timed_wait(boost::posix_time::milliseconds(UI_UPDATE_INTERVAL / 2)))
statusHandler.requestUiRefresh(); //may throw!
if (!ftDirExists.get())
return WaitResult(dirnameFmt);
@@ -151,7 +151,7 @@ rts::WaitResult rts::waitForChanges(const std::vector<Zstring>& dirNamesNonFmt,
}
}
- boost::this_thread::sleep(boost::posix_time::milliseconds(rts::UI_UPDATE_INTERVAL));
+ boost::this_thread::sleep(boost::posix_time::milliseconds(rts::UI_UPDATE_INTERVAL / 2));
statusHandler.requestUiRefresh(true); //throw ?: may start sync at this presumably idle time
}
}
@@ -178,7 +178,7 @@ void rts::waitForMissingDirs(const std::vector<Zstring>& dirNamesNonFmt, WaitCal
//2. check dir existence
return zen::dirExists(dirnameFmt);
});
- while (!ftDirExisting.timed_wait(boost::posix_time::milliseconds(rts::UI_UPDATE_INTERVAL)))
+ while (!ftDirExisting.timed_wait(boost::posix_time::milliseconds(rts::UI_UPDATE_INTERVAL / 2)))
statusHandler.requestUiRefresh(); //may throw!
if (!ftDirExisting.get())
@@ -191,10 +191,11 @@ void rts::waitForMissingDirs(const std::vector<Zstring>& dirNamesNonFmt, WaitCal
return;
//wait some time...
- assert_static(1000 * CHECK_DIR_INTERVAL % UI_UPDATE_INTERVAL == 0);
- for (int i = 0; i < 1000 * CHECK_DIR_INTERVAL / UI_UPDATE_INTERVAL; ++i)
+ const int refreshInterval = UI_UPDATE_INTERVAL / 2;
+ assert_static(1000 * CHECK_DIR_INTERVAL % refreshInterval == 0);
+ for (int i = 0; i < 1000 * CHECK_DIR_INTERVAL / refreshInterval; ++i)
{
- boost::this_thread::sleep(boost::posix_time::milliseconds(UI_UPDATE_INTERVAL));
+ boost::this_thread::sleep(boost::posix_time::milliseconds(refreshInterval));
statusHandler.requestUiRefresh();
}
}
bgstack15