diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2016-01-03 20:58:58 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2016-01-03 20:58:58 +0300 |
commit | 454ed688836c9de52039b84ea381ffd22890a6e8 (patch) | |
tree | dcbef23ab421b103cab60d04c4b36698ffeb35a4 | |
parent | 1a345f933f5b86fb297463863bd82334c94592c7 (diff) |
client-qt:
typo fix
very basic implementation of download state changes handler
-rw-r--r-- | client-qt/udm-client-qt/downloads_model.cpp | 3 | ||||
-rw-r--r-- | client-qt/udm-client-qt/udm_main.cpp | 21 | ||||
-rw-r--r-- | server/udm-server.project | 21 | ||||
-rw-r--r-- | udm.workspace | 10 |
4 files changed, 39 insertions, 16 deletions
diff --git a/client-qt/udm-client-qt/downloads_model.cpp b/client-qt/udm-client-qt/downloads_model.cpp index f5d8817..5789151 100644 --- a/client-qt/udm-client-qt/downloads_model.cpp +++ b/client-qt/udm-client-qt/downloads_model.cpp @@ -55,7 +55,6 @@ QVariant downloads_model::data(const QModelIndex &index, int role) const case 2: return (qint64)downloads[index.row()].downloaded(); break; - // case 3: if(downloads[index.row()].size()) return (qint64)((double)downloads[index.row()].downloaded() / (double)downloads[index.row()].size()) * 100.0; @@ -70,7 +69,7 @@ QVariant downloads_model::data(const QModelIndex &index, int role) const return tr("Stopped"); break; case 1: - return tr("Stopped"); + return tr("Started"); break; //TODO: handle module defined states default: diff --git a/client-qt/udm-client-qt/udm_main.cpp b/client-qt/udm-client-qt/udm_main.cpp index 48ff7c8..ab9b898 100644 --- a/client-qt/udm-client-qt/udm_main.cpp +++ b/client-qt/udm-client-qt/udm_main.cpp @@ -369,10 +369,26 @@ void udm_main::server_message_received(server_msg msg) switch(i.state()) { case SUBSCRIPTION_DOWNLOAD_STATE::SDS_STARTED: - //TODO: + for(auto d = downloads.begin(), end = downloads.end(); d != end; ++d) + { + if(d->id() == i.download_id()) + { + d->set_state(1); //TODO: use human readable enum for states ? + mdl_downloads->refresh(); //TODO: udapte only changed item + break; + } + } break; case SUBSCRIPTION_DOWNLOAD_STATE::SDS_STOPPED: - //TODO: + for(auto d = downloads.begin(), end = downloads.end(); d != end; ++d) + { + if(d->id() == i.download_id()) + { + d->set_state(0); //TODO: use human readable enum for states ? + mdl_downloads->refresh(); //TODO: udapte only changed item + break; + } + } break; case SUBSCRIPTION_DOWNLOAD_STATE::SDS_DELETED: { @@ -391,7 +407,6 @@ void udm_main::server_message_received(server_msg msg) BOOST_LOG_TRIVIAL(error)<<"error: deleted download which is not exist\n"<<msg.DebugString(); } } - //TODO: break; default: BOOST_LOG_TRIVIAL(error)<<"error: unhandled download state in server message message\n"<<msg.DebugString(); diff --git a/server/udm-server.project b/server/udm-server.project index 723dbd4..d8d0899 100644 --- a/server/udm-server.project +++ b/server/udm-server.project @@ -2,7 +2,7 @@ <CodeLite_Project Name="udm-server"> <Plugins> <Plugin Name="qmake"> - <![CDATA[00010001N0005Debug000000000000]]> + <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]> </Plugin> <Plugin Name="CMakePlugin"> <![CDATA[[{ @@ -14,6 +14,15 @@ "buildType": "", "arguments": [], "parentProject": "" + }, { + "name": "Release", + "enabled": false, + "buildDirectory": "build", + "sourceDirectory": "$(ProjectPath)", + "generator": "", + "buildType": "", + "arguments": [], + "parentProject": "" }]]]> </Plugin> </Plugins> @@ -138,15 +147,13 @@ </Completion> </Configuration> <Configuration Name="Release" CompilerType="GCC" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> - <Compiler Options="-O2 -Wall -DBOOST_LOG_DYN_LINK " C_Options="-O2 -Wall -DBOOST_LOG_DYN_LINK " Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0"> + <Compiler Options="-fno-fat-lto-objects -flto=8 -std=c++11 -O2 -Wall -DBOOST_LOG_DYN_LINK " C_Options="-fno-fat-lto-objects -flto=8 -std=c99 -O2 -Wall -DBOOST_LOG_DYN_LINK " Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0"> <IncludePath Value="server/include"/> <IncludePath Value="include"/> <IncludePath Value="include"/> <IncludePath Value="../protocol"/> </Compiler> - <Linker Options="-s " Required="yes"> - <LibraryPath Value="."/> - <LibraryPath Value="Debug"/> + <Linker Options="-s -flto=8 -fuse-linker-plugin" Required="yes"> <Library Value="protobuf"/> <Library Value="dl"/> <Library Value="boost_system"/> @@ -159,8 +166,8 @@ <Library Value="boost_random"/> </Linker> <ResourceCompiler Options="" Required="no"/> - <General OutputFile="bin/Release/udm-server" IntermediateDirectory="./Debug" Command="./udm-server" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="bin/Release" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/> - <Environment EnvVarSetName="<Use Workspace Settings>" DbgSetName="<Use Global Settings>"> + <General OutputFile="bin/Release/udm-server" IntermediateDirectory="./Release" Command="./udm-server" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="bin/Release" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/> + <Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> <![CDATA[]]> </Environment> <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="" IsExtended="no"> diff --git a/udm.workspace b/udm.workspace index f4ab096..a531e89 100644 --- a/udm.workspace +++ b/udm.workspace @@ -3,19 +3,21 @@ <Project Name="udm-server" Path="server/udm-server.project" Active="Yes"/> <Project Name="module_metadata_flat_files" Path="server/modules/metadata/flat_files/module_metadata_flat_files.project" Active="No"/> <Project Name="curl" Path="server/modules/downloaders/curl/curl.project" Active="No"/> + <Environment> + <![CDATA[]]> + </Environment> <BuildMatrix> <WorkspaceConfiguration Name="Debug" Selected="yes"> + <Environment/> <Project Name="udm-server" ConfigName="Debug"/> <Project Name="module_metadata_flat_files" ConfigName="Debug"/> <Project Name="curl" ConfigName="Debug"/> </WorkspaceConfiguration> - <WorkspaceConfiguration Name="Release" Selected="yes"> + <WorkspaceConfiguration Name="Release" Selected="no"> + <Environment/> <Project Name="udm-server" ConfigName="Release"/> <Project Name="module_metadata_flat_files" ConfigName="Release"/> <Project Name="curl" ConfigName="Release"/> </WorkspaceConfiguration> </BuildMatrix> - <Environment> - <![CDATA[]]> - </Environment> </CodeLite_Workspace> |