mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Synchronize Command
- Added the stub of the sync command.
This commit is contained in:
parent
b3bd522f73
commit
becd8f155c
7 changed files with 33 additions and 31 deletions
|
@ -46,7 +46,7 @@ set (commands_SRCS Command.cpp Command.h
|
|||
CmdStatistics.cpp CmdStatistics.h
|
||||
CmdStop.cpp CmdStop.h
|
||||
CmdSummary.cpp CmdSummary.h
|
||||
CmdSynch.cpp CmdSynch.h
|
||||
CmdSync.cpp CmdSync.h
|
||||
CmdTags.cpp CmdTags.h
|
||||
CmdTimesheet.cpp CmdTimesheet.h
|
||||
CmdUDAs.cpp CmdUDAs.h
|
||||
|
|
|
@ -273,10 +273,10 @@ int CmdStatistics::execute (std::string& output)
|
|||
}
|
||||
|
||||
/*
|
||||
// TODO Re-enable this when 2.1 has taskd support. Until then, it makes no
|
||||
// TODO Re-enable this when 2.3 has taskd support. Until then, it makes no
|
||||
// sense to include this.
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, STRING_CMD_STATS_LAST_SYNCH);
|
||||
view.set (row, 0, STRING_CMD_STATS_LAST_SYNC);
|
||||
if (context.tdb2.synch_key._file.exists ())
|
||||
view.set (row, 1, Date (context.tdb2.synch_key._file.mtime ()).toISO ());
|
||||
else
|
||||
|
|
|
@ -31,48 +31,39 @@
|
|||
#include <Context.h>
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
#include <CmdSynch.h>
|
||||
#include <CmdSync.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CmdSynch::CmdSynch ()
|
||||
CmdSync::CmdSync ()
|
||||
{
|
||||
_keyword = "synchronize";
|
||||
_usage = "task synchronize";
|
||||
_description = STRING_CMD_SYNCH_USAGE;
|
||||
_description = STRING_CMD_SYNC_USAGE;
|
||||
_read_only = false;
|
||||
_displays_id = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdSynch::execute (std::string& output)
|
||||
int CmdSync::execute (std::string& output)
|
||||
{
|
||||
// TODO Tempporary.
|
||||
std::cout << "\n"
|
||||
<< "Task Server Synchronization is not implemented in 2.0.0beta3.\n"
|
||||
<< "\n";
|
||||
|
||||
// If no server is set up, quit.
|
||||
std::string connection = context.config.get ("taskd.server");
|
||||
if (connection == "" ||
|
||||
connection.find (':') == std::string::npos)
|
||||
throw std::string (STRING_CMD_SYNCH_NO_SERVER);
|
||||
throw std::string (STRING_CMD_SYNC_NO_SERVER);
|
||||
|
||||
// Obtain credentials.
|
||||
std::string credentials = context.config.get ("taskd.credentials");
|
||||
|
||||
// TODO Obtain synch key.
|
||||
// TODO Read backlog.data.
|
||||
// TODO Send backlog.data in 'sync' request..
|
||||
|
||||
// TODO Compose backlog into ticket.
|
||||
// TODO Request synch.
|
||||
|
||||
// TODO Receive synch data.
|
||||
// TODO Extract remote mods.
|
||||
// TODO Extract new synch key.
|
||||
// TODO Apply remote mods.
|
||||
// TODO Receive response.
|
||||
// TODO Apply tasks.
|
||||
// TODO Truncate backlog.data.
|
||||
// TODO Store new synch key.
|
||||
// TODO Truncate backlog.
|
||||
|
||||
return 1;
|
||||
}
|
|
@ -25,17 +25,17 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDED_CMDSYNCH
|
||||
#define INCLUDED_CMDSYNCH
|
||||
#ifndef INCLUDED_CMDSYNC
|
||||
#define INCLUDED_CMDSYNC
|
||||
#define L10N // Localization complete.
|
||||
|
||||
#include <string>
|
||||
#include <Command.h>
|
||||
|
||||
class CmdSynch : public Command
|
||||
class CmdSync : public Command
|
||||
{
|
||||
public:
|
||||
CmdSynch ();
|
||||
CmdSync ();
|
||||
int execute (std::string&);
|
||||
};
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
#include <CmdStatistics.h>
|
||||
#include <CmdStop.h>
|
||||
#include <CmdSummary.h>
|
||||
//#include <CmdSynch.h>
|
||||
#include <CmdSync.h>
|
||||
#include <CmdTags.h>
|
||||
#include <CmdTimesheet.h>
|
||||
#include <CmdUDAs.h>
|
||||
|
@ -158,7 +158,7 @@ void Command::factory (std::map <std::string, Command*>& all)
|
|||
c = new CmdStatistics (); all[c->keyword ()] = c;
|
||||
c = new CmdStop (); all[c->keyword ()] = c;
|
||||
c = new CmdSummary (); all[c->keyword ()] = c;
|
||||
// c = new CmdSynch (); all[c->keyword ()] = c;
|
||||
c = new CmdSync (); all[c->keyword ()] = c;
|
||||
c = new CmdTags (); all[c->keyword ()] = c;
|
||||
c = new CmdTimesheet (); all[c->keyword ()] = c;
|
||||
c = new CmdUDAs (); all[c->keyword ()] = c;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue