mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Build
- Enabled compiler warnings, which were off. Yikes. - Fixed all compiler warnings on OSX.
This commit is contained in:
parent
36e24fa1fb
commit
0260aff441
40 changed files with 121 additions and 82 deletions
|
@ -83,7 +83,7 @@ static int api_task_debug_message (lua_State* L)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Causes the shell or interactive mode task to exit. Ordinarily this does not
|
||||
// occur.
|
||||
static int api_task_exit (lua_State* L)
|
||||
static int api_task_exit (lua_State*)
|
||||
{
|
||||
// TODO Is this the correct exception? How does the shell handle this?
|
||||
std::cout << "Exiting." << std::endl;
|
||||
|
@ -105,6 +105,8 @@ static int api_task_get (lua_State* L)
|
|||
// TODO Error!
|
||||
lua_pushstring (L, "");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -123,6 +125,8 @@ static int api_task_set (lua_State* L)
|
|||
// TODO Error!
|
||||
lua_pushstring (L, "");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -286,7 +286,7 @@ void Arguments::extract_sequence (std::vector <int>& sequence)
|
|||
std::vector <int> kill;
|
||||
|
||||
bool terminated = false;
|
||||
for (int i = 0; i < this->size (); ++i)
|
||||
for (unsigned int i = 0; i < this->size (); ++i)
|
||||
{
|
||||
if (!terminated)
|
||||
{
|
||||
|
@ -358,7 +358,7 @@ void Arguments::extract_sequence (std::vector <int>& sequence)
|
|||
}
|
||||
|
||||
// Now remove args in the kill list.
|
||||
for (int k = 0; k < kill.size (); ++k)
|
||||
for (unsigned int k = 0; k < kill.size (); ++k)
|
||||
this->erase (this->begin () + kill[k]);
|
||||
}
|
||||
|
||||
|
|
|
@ -606,7 +606,9 @@ bool Att::match (const Att& other) const
|
|||
bool case_sensitive = context.config.getBoolean ("search.case.sensitive");
|
||||
|
||||
// Are regular expressions being used in place of string comparison?
|
||||
#ifdef FEATURE_REGEX
|
||||
bool regex = context.config.getBoolean ("regex");
|
||||
#endif
|
||||
|
||||
// If there are no mods, just perform a straight compare on value.
|
||||
if (mMod == "")
|
||||
|
|
|
@ -65,5 +65,6 @@ set_property (TARGET task_executable PROPERTY OUTPUT_NAME "task")
|
|||
install (TARGETS task_executable DESTINATION ${TASK_BINDIR})
|
||||
|
||||
set (CMAKE_BUILD_TYPE debug)
|
||||
set (CMAKE_C_FLAGS_DEBUG "-ggdb3")
|
||||
set (CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3 -Wall")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall")
|
||||
|
||||
|
|
|
@ -91,7 +91,6 @@ std::string json::string::dump ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
json::number* json::number::parse (Nibbler& nibbler)
|
||||
{
|
||||
int i;
|
||||
double d;
|
||||
if (nibbler.getNumber (d))
|
||||
{
|
||||
|
|
|
@ -299,8 +299,6 @@ int TDB::loadPending (std::vector <Task>& tasks, Filter& filter)
|
|||
{
|
||||
// TODO Add hidden attribute indicating source?
|
||||
Task task (line);
|
||||
|
||||
Task::status status = task.getStatus ();
|
||||
task.id = mId++;
|
||||
|
||||
mPending.push_back (task);
|
||||
|
|
|
@ -51,6 +51,7 @@ Variant::Variant (const Variant& other)
|
|||
case v_string: mString = other.mString; break;
|
||||
case v_date: mDate = other.mDate; break;
|
||||
case v_duration: mDuration = other.mDuration; break;
|
||||
case v_unknown: break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,6 +148,9 @@ Variant& Variant::operator<= (const Variant& other)
|
|||
case v_duration:
|
||||
mBool = (time_t)mDuration <= (time_t)other.mDuration ? true : false;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
mType = v_boolean;
|
||||
|
@ -184,6 +188,9 @@ Variant& Variant::operator>= (const Variant& other)
|
|||
case v_duration:
|
||||
mBool = (time_t)mDuration >= (time_t)other.mDuration ? true : false;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
mType = v_boolean;
|
||||
|
@ -221,6 +228,9 @@ Variant& Variant::operator== (const Variant& other)
|
|||
case v_duration:
|
||||
mBool = mDuration == other.mDuration ? true : false;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
mType = v_boolean;
|
||||
|
@ -258,6 +268,9 @@ Variant& Variant::operator!= (const Variant& other)
|
|||
case v_duration:
|
||||
mBool = mDuration != other.mDuration ? true : false;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
mType = v_boolean;
|
||||
|
@ -292,6 +305,9 @@ Variant& Variant::operator^ (const Variant& other)
|
|||
case v_duration:
|
||||
throw std::string ("Cannot perform exponentiation on duration types");
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -335,6 +351,9 @@ Variant& Variant::operator- (const Variant& other)
|
|||
// TODO Missing operator -=
|
||||
//mDuration -= other.mDuration;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -370,6 +389,9 @@ Variant& Variant::operator+ (const Variant& other)
|
|||
// TODO operator+ missing
|
||||
//mDuration += other.mDuration;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -403,6 +425,9 @@ Variant& Variant::operator* (const Variant& other)
|
|||
case v_duration:
|
||||
throw std::string ("Cannot perform multiplication on duration types");
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -436,6 +461,9 @@ Variant& Variant::operator/ (const Variant& other)
|
|||
case v_duration:
|
||||
throw std::string ("Cannot perform division on duration types");
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -472,6 +500,9 @@ Variant& Variant::operator< (const Variant& other)
|
|||
case v_duration:
|
||||
mBool = mDuration < other.mDuration ? true : false;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
mType = v_boolean;
|
||||
|
@ -509,6 +540,9 @@ Variant& Variant::operator> (const Variant& other)
|
|||
case v_duration:
|
||||
mBool = mDuration > other.mDuration ? true : false;
|
||||
break;
|
||||
|
||||
case v_unknown:
|
||||
break;
|
||||
}
|
||||
|
||||
mType = v_boolean;
|
||||
|
|
|
@ -44,8 +44,7 @@ public:
|
|||
v_double = 8,
|
||||
v_string = 16,
|
||||
v_date = 32,
|
||||
v_duration = 64,
|
||||
v_other = 128
|
||||
v_duration = 64
|
||||
};
|
||||
|
||||
Variant ();
|
||||
|
|
|
@ -114,12 +114,12 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
int global_min = utf8_length ((*i)->getLabel ());
|
||||
int global_ideal = global_min;
|
||||
|
||||
for (int s = 0; s < sequence.size (); ++s)
|
||||
for (unsigned int s = 0; s < sequence.size (); ++s)
|
||||
{
|
||||
if (s >= _truncate_lines && _truncate_lines != 0)
|
||||
if ((int)s >= _truncate_lines && _truncate_lines != 0)
|
||||
break;
|
||||
|
||||
if (s >= _truncate_rows && _truncate_rows != 0)
|
||||
if ((int)s >= _truncate_rows && _truncate_rows != 0)
|
||||
break;
|
||||
|
||||
// Determine minimum and ideal width for this column.
|
||||
|
@ -175,7 +175,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
while (overage && needed)
|
||||
{
|
||||
needed = false;
|
||||
for (int i = 0; i < _columns.size () && overage; ++i)
|
||||
for (unsigned int i = 0; i < _columns.size () && overage; ++i)
|
||||
{
|
||||
if (widths[i] < ideal[i])
|
||||
{
|
||||
|
@ -188,9 +188,9 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
}
|
||||
|
||||
// Compose column headers.
|
||||
int max_lines = 0;
|
||||
unsigned int max_lines = 0;
|
||||
std::vector <std::vector <std::string> > headers;
|
||||
for (int c = 0; c < _columns.size (); ++c)
|
||||
for (unsigned int c = 0; c < _columns.size (); ++c)
|
||||
{
|
||||
headers.push_back (std::vector <std::string> ());
|
||||
_columns[c]->renderHeader (headers[c], widths[c], _header);
|
||||
|
@ -213,11 +213,11 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
std::string intra_odd = context.color () ? _intra_odd.colorize (intra) : intra;
|
||||
std::string intra_even = context.color () ? _intra_even.colorize (intra) : intra;
|
||||
|
||||
for (int i = 0; i < max_lines; ++i)
|
||||
for (unsigned int i = 0; i < max_lines; ++i)
|
||||
{
|
||||
out += left_margin + extra;
|
||||
|
||||
for (int c = 0; c < _columns.size (); ++c)
|
||||
for (unsigned int c = 0; c < _columns.size (); ++c)
|
||||
{
|
||||
if (c)
|
||||
out += intra;
|
||||
|
@ -243,7 +243,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
_rows = 0;
|
||||
std::vector <std::vector <std::string> > cells;
|
||||
std::vector <int>::iterator s;
|
||||
for (int s = 0; s < sequence.size (); ++s)
|
||||
for (unsigned int s = 0; s < sequence.size (); ++s)
|
||||
{
|
||||
max_lines = 0;
|
||||
|
||||
|
@ -260,7 +260,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
row_color.blend (rule_color);
|
||||
}
|
||||
|
||||
for (int c = 0; c < _columns.size (); ++c)
|
||||
for (unsigned int c = 0; c < _columns.size (); ++c)
|
||||
{
|
||||
cells.push_back (std::vector <std::string> ());
|
||||
_columns[c]->render (cells[c], data[sequence[s]], widths[c], row_color);
|
||||
|
@ -269,11 +269,11 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
max_lines = cells[c].size ();
|
||||
}
|
||||
|
||||
for (int i = 0; i < max_lines; ++i)
|
||||
for (unsigned int i = 0; i < max_lines; ++i)
|
||||
{
|
||||
out += left_margin + (odd ? extra_odd : extra_even);
|
||||
|
||||
for (int c = 0; c < _columns.size (); ++c)
|
||||
for (unsigned int c = 0; c < _columns.size (); ++c)
|
||||
{
|
||||
if (c)
|
||||
{
|
||||
|
|
|
@ -110,13 +110,13 @@ std::string ViewText::render ()
|
|||
// Determine minimal, ideal column widths.
|
||||
std::vector <int> minimal;
|
||||
std::vector <int> ideal;
|
||||
for (int col = 0; col < _columns.size (); ++col)
|
||||
for (unsigned int col = 0; col < _columns.size (); ++col)
|
||||
{
|
||||
// Headers factor in to width calculations.
|
||||
int global_min = utf8_length (_columns[col]->getLabel ());
|
||||
int global_ideal = global_min;
|
||||
|
||||
for (int row = 0; row < _data.size (); ++row)
|
||||
for (unsigned int row = 0; row < _data.size (); ++row)
|
||||
{
|
||||
// Determine minimum and ideal width for this column.
|
||||
int min;
|
||||
|
@ -162,7 +162,7 @@ std::string ViewText::render ()
|
|||
// Spread 'overage' among columns where width[i] < ideal[i]
|
||||
while (overage)
|
||||
{
|
||||
for (int i = 0; i < _columns.size () && overage; ++i)
|
||||
for (unsigned int i = 0; i < _columns.size () && overage; ++i)
|
||||
{
|
||||
if (widths[i] < ideal[i])
|
||||
{
|
||||
|
@ -174,9 +174,9 @@ std::string ViewText::render ()
|
|||
}
|
||||
|
||||
// Compose column headers.
|
||||
int max_lines = 0;
|
||||
unsigned int max_lines = 0;
|
||||
std::vector <std::vector <std::string> > headers;
|
||||
for (int c = 0; c < _columns.size (); ++c)
|
||||
for (unsigned int c = 0; c < _columns.size (); ++c)
|
||||
{
|
||||
headers.push_back (std::vector <std::string> ());
|
||||
_columns[c]->renderHeader (headers[c], widths[c], _header);
|
||||
|
@ -199,11 +199,11 @@ std::string ViewText::render ()
|
|||
std::string intra_odd = context.color () ? _intra_odd.colorize (intra) : intra;
|
||||
std::string intra_even = context.color () ? _intra_even.colorize (intra) : intra;
|
||||
|
||||
for (int i = 0; i < max_lines; ++i)
|
||||
for (unsigned int i = 0; i < max_lines; ++i)
|
||||
{
|
||||
out += left_margin + extra;
|
||||
|
||||
for (int c = 0; c < _columns.size (); ++c)
|
||||
for (unsigned int c = 0; c < _columns.size (); ++c)
|
||||
{
|
||||
if (c)
|
||||
out += intra;
|
||||
|
@ -228,7 +228,7 @@ std::string ViewText::render ()
|
|||
// Compose, render columns, in sequence.
|
||||
_rows = 0;
|
||||
std::vector <std::vector <std::string> > cells;
|
||||
for (int row = 0; row < _data.size (); ++row)
|
||||
for (unsigned int row = 0; row < _data.size (); ++row)
|
||||
{
|
||||
max_lines = 0;
|
||||
|
||||
|
@ -241,7 +241,7 @@ std::string ViewText::render ()
|
|||
// therefore there are only cell colors, not intra colors.
|
||||
|
||||
Color cell_color;
|
||||
for (int col = 0; col < _columns.size (); ++col)
|
||||
for (unsigned int col = 0; col < _columns.size (); ++col)
|
||||
{
|
||||
if (context.color ())
|
||||
{
|
||||
|
@ -256,11 +256,11 @@ std::string ViewText::render ()
|
|||
max_lines = cells[col].size ();
|
||||
}
|
||||
|
||||
for (int i = 0; i < max_lines; ++i)
|
||||
for (unsigned int i = 0; i < max_lines; ++i)
|
||||
{
|
||||
out += left_margin + (odd ? extra_odd : extra_even);
|
||||
|
||||
for (int col = 0; col < _columns.size (); ++col)
|
||||
for (unsigned int col = 0; col < _columns.size (); ++col)
|
||||
{
|
||||
if (col)
|
||||
{
|
||||
|
|
|
@ -28,5 +28,5 @@ set (columns_SRCS Column.cpp Column.h
|
|||
add_library (columns STATIC ${columns_SRCS})
|
||||
|
||||
set (CMAKE_BUILD_TYPE debug)
|
||||
set (CMAKE_C_FLAGS_DEBUG "-ggdb3")
|
||||
set (CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3 -Wall")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall")
|
||||
|
|
|
@ -75,7 +75,7 @@ void ColumnTags::measure (Task& task, int& minimum, int& maximum)
|
|||
split (all, tags, ',');
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = all.begin (); i != all.end (); ++i)
|
||||
if (i->length () > minimum)
|
||||
if ((int)i->length () > minimum)
|
||||
minimum = i->length () + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ ColumnUUID::~ColumnUUID ()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Set the minimum and maximum widths for the value.
|
||||
void ColumnUUID::measure (Task& task, int& minimum, int& maximum)
|
||||
void ColumnUUID::measure (Task&, int& minimum, int& maximum)
|
||||
{
|
||||
if (_style == "default") minimum = maximum = 36;
|
||||
else if (_style == "short") minimum = maximum = 8;
|
||||
|
|
|
@ -174,25 +174,25 @@ void Column::renderHeader (
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Column::measure (const std::string& value, int& minimum, int& maximum)
|
||||
void Column::measure (const std::string&, int&, int&)
|
||||
{
|
||||
throw std::string ("Virtual method Column::measure not overriden.");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Column::measure (Task& task, int& minimum, int& maximum)
|
||||
void Column::measure (Task&, int&, int&)
|
||||
{
|
||||
throw std::string ("Virtual method Column::measure not overriden.");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Column::render (std::vector <std::string>& lines, const std::string& value, int width, Color& color)
|
||||
void Column::render (std::vector <std::string>&, const std::string&, int, Color&)
|
||||
{
|
||||
throw std::string ("Virtual method Column::render not overriden.");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Column::render (std::vector <std::string>& lines, Task& task, int width, Color& color)
|
||||
void Column::render (std::vector <std::string>&, Task&, int, Color&)
|
||||
{
|
||||
throw std::string ("Virtual method Column::render not overriden.");
|
||||
}
|
||||
|
|
|
@ -280,7 +280,7 @@ void handleUndo ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void handleMerge (std::string& outs)
|
||||
void handleMerge (std::string&)
|
||||
{
|
||||
std::string file = trim (context.task.get ("description"));
|
||||
std::string pushfile = "";
|
||||
|
@ -337,7 +337,7 @@ void handleMerge (std::string& outs)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Transfers the local data (from rc.location.data) to the remote path. Because
|
||||
// this is potentially on another machine, no checking can be performed.
|
||||
void handlePush (std::string& outs)
|
||||
void handlePush (std::string&)
|
||||
{
|
||||
std::string file = trim (context.task.get ("description"));
|
||||
|
||||
|
@ -387,7 +387,7 @@ void handlePush (std::string& outs)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void handlePull (std::string& outs)
|
||||
void handlePull (std::string&)
|
||||
{
|
||||
std::string file = trim (context.task.get ("description"));
|
||||
|
||||
|
|
|
@ -32,5 +32,5 @@ set (commands_SRCS Command.cpp Command.h
|
|||
add_library (commands STATIC ${commands_SRCS})
|
||||
|
||||
set (CMAKE_BUILD_TYPE debug)
|
||||
set (CMAKE_C_FLAGS_DEBUG "-ggdb3")
|
||||
set (CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3 -Wall")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall")
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdAppend::CmdAppend ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdAppend::execute (const std::string& command_line, std::string& output)
|
||||
int CmdAppend::execute (const std::string&, std::string& output)
|
||||
{
|
||||
if (!context.task.has ("description"))
|
||||
throw std::string ("Additional text must be provided.");
|
||||
|
|
|
@ -45,7 +45,7 @@ CmdCompletionCommands::CmdCompletionCommands ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionCommands::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionCommands::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Get a list of all commands.
|
||||
std::vector <std::string> commands;
|
||||
|
@ -81,7 +81,7 @@ CmdZshCommands::CmdZshCommands ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdZshCommands::execute (const std::string& command_line, std::string& output)
|
||||
int CmdZshCommands::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Get a list of all commands.
|
||||
std::vector <std::string> commands;
|
||||
|
|
|
@ -43,7 +43,7 @@ CmdCount::CmdCount ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCount::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCount::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Scan the pending tasks, applying any filter.
|
||||
std::vector <Task> tasks;
|
||||
|
|
|
@ -51,7 +51,7 @@ CmdCustom::CmdCustom (
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCustom::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCustom::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
@ -120,7 +120,7 @@ int CmdCustom::execute (const std::string& command_line, std::string& output)
|
|||
|
||||
// Sort the tasks.
|
||||
std::vector <int> sequence;
|
||||
for (int i = 0; i < tasks.size (); ++i)
|
||||
for (unsigned int i = 0; i < tasks.size (); ++i)
|
||||
sequence.push_back (i);
|
||||
|
||||
sort_tasks (tasks, sequence, reportSort);
|
||||
|
@ -140,7 +140,7 @@ int CmdCustom::execute (const std::string& command_line, std::string& output)
|
|||
view.intraColorOdd (alternate);
|
||||
|
||||
// Add the columns and labels.
|
||||
for (int i = 0; i < columns.size (); ++i)
|
||||
for (unsigned int i = 0; i < columns.size (); ++i)
|
||||
{
|
||||
Column* c = Column::factory (columns[i], _keyword);
|
||||
c->setLabel (labels[i]);
|
||||
|
@ -179,10 +179,10 @@ int CmdCustom::execute (const std::string& command_line, std::string& output)
|
|||
<< tasks.size ()
|
||||
<< (tasks.size () == 1 ? " task" : " tasks");
|
||||
|
||||
if (maxrows && maxrows < tasks.size ())
|
||||
if (maxrows && maxrows < (int)tasks.size ())
|
||||
out << ", " << maxrows << " shown";
|
||||
|
||||
if (maxlines && maxlines < tasks.size ())
|
||||
if (maxlines && maxlines < (int)tasks.size ())
|
||||
out << ", truncated to " << maxlines - table_header << " lines";
|
||||
|
||||
out << "\n";
|
||||
|
|
|
@ -63,7 +63,7 @@ CmdDiagnostics::CmdDiagnostics ()
|
|||
//
|
||||
// Although this will change over time, initially this command will answer the
|
||||
// kind of questions we always have to ask whenever something is wrong.
|
||||
int CmdDiagnostics::execute (const std::string& command_line, std::string& output)
|
||||
int CmdDiagnostics::execute (const std::string&, std::string& output)
|
||||
{
|
||||
Color bold ("bold");
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ CmdEdit::CmdEdit ()
|
|||
// Introducing the Silver Bullet. This feature is the catch-all fixative for
|
||||
// various other ills. This is like opening up the hood and going in with a
|
||||
// wrench. To be used sparingly.
|
||||
int CmdEdit::execute (const std::string& command_line, std::string& output)
|
||||
int CmdEdit::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ CmdExec::CmdExec ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdExec::execute (const std::string& command_line, std::string& output)
|
||||
int CmdExec::execute (const std::string& command_line, std::string&)
|
||||
{
|
||||
return system (command_line.c_str ());
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdHelp::CmdHelp ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHelp::execute (const std::string& command_line, std::string& output)
|
||||
int CmdHelp::execute (const std::string&, std::string& output)
|
||||
{
|
||||
ViewText view;
|
||||
view.width (context.getWidth ());
|
||||
|
|
|
@ -46,7 +46,7 @@ CmdHistoryMonthly::CmdHistoryMonthly ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHistoryMonthly::execute (const std::string& command_line, std::string& output)
|
||||
int CmdHistoryMonthly::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
@ -202,7 +202,7 @@ CmdHistoryAnnual::CmdHistoryAnnual ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHistoryAnnual::execute (const std::string& command_line, std::string& output)
|
||||
int CmdHistoryAnnual::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
@ -355,7 +355,7 @@ CmdGHistoryMonthly::CmdGHistoryMonthly ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdGHistoryMonthly::execute (const std::string& command_line, std::string& output)
|
||||
int CmdGHistoryMonthly::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
@ -551,7 +551,7 @@ CmdGHistoryAnnual::CmdGHistoryAnnual ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdGHistoryAnnual::execute (const std::string& command_line, std::string& output)
|
||||
int CmdGHistoryAnnual::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
|
|
@ -45,7 +45,7 @@ CmdIDs::CmdIDs ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdIDs::execute (const std::string& command_line, std::string& output)
|
||||
int CmdIDs::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Scan the pending tasks, applying any filter.
|
||||
std::vector <Task> tasks;
|
||||
|
@ -78,7 +78,7 @@ CmdCompletionIds::CmdCompletionIds ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionIds::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionIds::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
@ -116,7 +116,7 @@ CmdZshCompletionIds::CmdZshCompletionIds ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdZshCompletionIds::execute (const std::string& command_line, std::string& output)
|
||||
int CmdZshCompletionIds::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
|
|
@ -47,7 +47,7 @@ CmdInfo::CmdInfo ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdInfo::execute (const std::string& command_line, std::string& output)
|
||||
int CmdInfo::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ CmdInstall::CmdInstall ()
|
|||
// Generate UUID
|
||||
// Call the "install" function once, store results in rc:
|
||||
// extension.<uuid>=<JSON>
|
||||
int CmdInstall::execute (const std::string& commandLine, std::string& output)
|
||||
int CmdInstall::execute (const std::string&, std::string&)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ CmdLogo::CmdLogo ()
|
|||
// Generate UUID
|
||||
// Call the "install" function once, store results in rc:
|
||||
// extension.<uuid>=<JSON>
|
||||
int CmdLogo::execute (const std::string& commandLine, std::string& output)
|
||||
int CmdLogo::execute (const std::string&, std::string& output)
|
||||
{
|
||||
static const char* data[] =
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdPrepend::CmdPrepend ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdPrepend::execute (const std::string& command_line, std::string& output)
|
||||
int CmdPrepend::execute (const std::string&, std::string& output)
|
||||
{
|
||||
if (!context.task.has ("description"))
|
||||
throw std::string ("Additional text must be provided.");
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdProjects::CmdProjects ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdProjects::execute (const std::string& command_line, std::string& output)
|
||||
int CmdProjects::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
@ -142,7 +142,7 @@ CmdCompletionProjects::CmdCompletionProjects ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionProjects::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionProjects::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
|
|
@ -45,7 +45,7 @@ CmdShell::CmdShell ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdShell::execute (const std::string& command_line, std::string& output)
|
||||
int CmdShell::execute (const std::string&, std::string&)
|
||||
{
|
||||
// Display some kind of welcome message.
|
||||
Color bold (Color::nocolor, Color::nocolor, false, true, false);
|
||||
|
|
|
@ -50,7 +50,7 @@ CmdShow::CmdShow ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdShow::execute (const std::string& command_line, std::string& output)
|
||||
int CmdShow::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
|
|
@ -49,7 +49,7 @@ CmdStatistics::CmdStatistics ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdStatistics::execute (const std::string& command_line, std::string& output)
|
||||
int CmdStatistics::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
|
|
@ -46,7 +46,7 @@ CmdTags::CmdTags ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdTags::execute (const std::string& command_line, std::string& output)
|
||||
int CmdTags::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
@ -131,7 +131,7 @@ CmdCompletionTags::CmdCompletionTags ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionTags::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionTags::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdUrgency::CmdUrgency ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdUrgency::execute (const std::string& command_line, std::string& output)
|
||||
int CmdUrgency::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Get all the tasks.
|
||||
std::vector <Task> tasks;
|
||||
|
|
|
@ -46,7 +46,7 @@ CmdVersion::CmdVersion ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdVersion::execute (const std::string& command_line, std::string& output)
|
||||
int CmdVersion::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
|
@ -129,7 +129,7 @@ CmdCompletionVersion::CmdCompletionVersion ()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionVersion::execute (
|
||||
const std::string& command_line,
|
||||
const std::string&,
|
||||
std::string& output)
|
||||
{
|
||||
#ifdef HAVE_COMMIT
|
||||
|
|
|
@ -291,8 +291,10 @@ std::string renderAttribute (const std::string& name, const std::string& value)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TODO Implement all the post-command feedback here. This includes project
|
||||
// completion percentages, "3 tasks modified", all warnings, and so on.
|
||||
std::string feedback (const Task& before, const Task& after)
|
||||
std::string feedback (const Task&, const Task&)
|
||||
{
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -67,7 +67,6 @@ void sort_tasks (
|
|||
// Essentially a static implementation of a dynamic operator<.
|
||||
static bool sort_compare (int left, int right)
|
||||
{
|
||||
int result;
|
||||
std::string field;
|
||||
bool ascending;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue