- Cleaner solution (less code duplication and blank space only when a
  confirmation is needed) for bug #1038.
This commit is contained in:
Louis-Claude Canon 2012-07-24 18:11:09 +02:00 committed by Paul Beckingham
parent 3bf9ebad62
commit e5d142a468
13 changed files with 10 additions and 21 deletions

View file

@ -1,6 +1,8 @@
------ current release ---------------------------
2.2.0 ()
Bugs
+ Fixed bug #1038, which prints blank lines with bulk changes and when the
verbose attributes does not specify it. Lines do a better separation between
each changes also.

View file

@ -119,8 +119,6 @@ int CmdAnnotate::execute (std::string& output)
std::cout << STRING_CMD_ANNO_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
// Now list the project changes.

View file

@ -119,8 +119,6 @@ int CmdAppend::execute (std::string& output)
std::cout << STRING_CMD_APPEND_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
// Now list the project changes.

View file

@ -143,8 +143,6 @@ int CmdDelete::execute (std::string& output)
std::cout << STRING_CMD_DELETE_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
else
{

View file

@ -132,8 +132,6 @@ int CmdDenotate::execute (std::string& output)
std::cout << STRING_CMD_DENO_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
else
{

View file

@ -120,8 +120,6 @@ int CmdDone::execute (std::string& output)
<< "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
// Now list the project changes.

View file

@ -125,8 +125,6 @@ int CmdDuplicate::execute (std::string& output)
std::cout << STRING_CMD_DUPLICATE_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
// Now list the project changes.

View file

@ -162,8 +162,6 @@ int CmdModify::execute (std::string& output)
std::cout << STRING_CMD_MODIFY_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
}

View file

@ -119,8 +119,6 @@ int CmdPrepend::execute (std::string& output)
std::cout << STRING_CMD_PREPEND_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
// Now list the project changes.

View file

@ -104,8 +104,6 @@ int CmdStart::execute (std::string& output)
std::cout << STRING_CMD_START_NO << "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
else
{

View file

@ -109,8 +109,6 @@ int CmdStop::execute (std::string& output)
<< "\n";
rc = 1;
}
if (context.verbose ("blank"))
std::cout << "\n";
}
// Now list the project changes.

View file

@ -210,6 +210,7 @@ Command::Command ()
, _needs_confirm (false)
, _permission_quit (false)
, _permission_all (false)
, _first_iteration (true)
{
}
@ -223,6 +224,7 @@ Command::Command (const Command& other)
_needs_confirm = other._needs_confirm;
_permission_quit = other._permission_quit;
_permission_all = other._permission_all;
_first_iteration = other._first_iteration;
}
////////////////////////////////////////////////////////////////////////////////
@ -237,6 +239,7 @@ Command& Command::operator= (const Command& other)
_needs_confirm = other._needs_confirm;
_permission_quit = other._permission_quit;
_permission_all = other._permission_all;
_first_iteration = other._first_iteration;
}
return *this;
@ -718,9 +721,12 @@ bool Command::permission (
// 1 < Quantity < bulk modifications have optional confirmation, in the (y/n/a/q)
// style.
if (quantity < bulk && (!_needs_confirm || !confirmation))
return true;
return true;
if (context.verbose ("blank") && !_first_iteration)
std::cout << "\n";
int answer = confirm4 (question);
_first_iteration = false;
switch (answer)
{
case 1: return true; // yes

View file

@ -80,6 +80,7 @@ protected:
// Permission support
bool _permission_quit;
bool _permission_all;
bool _first_iteration;
};
#endif