summaryrefslogtreecommitdiff
path: root/apt-pkg/install-progress.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/install-progress.cc')
-rw-r--r--apt-pkg/install-progress.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index 5ea8bf4d0..14409e301 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -8,13 +8,12 @@
#include <signal.h>
#include <unistd.h>
#include <iostream>
-#include <string>
#include <vector>
#include <sys/ioctl.h>
-#include <sstream>
#include <fcntl.h>
#include <algorithm>
#include <stdio.h>
+#include <sstream>
#include <apti18n.h>
@@ -65,10 +64,11 @@ bool PackageManager::StatusChanged(std::string /*PackageName*/,
}
PackageManagerProgressFd::PackageManagerProgressFd(int progress_fd)
- : StepsDone(0), StepsTotal(1)
+ : d(NULL), StepsDone(0), StepsTotal(1)
{
OutStatusFd = progress_fd;
}
+PackageManagerProgressFd::~PackageManagerProgressFd() {}
void PackageManagerProgressFd::WriteToStatusFd(std::string s)
{
@@ -153,10 +153,11 @@ bool PackageManagerProgressFd::StatusChanged(std::string PackageName,
PackageManagerProgressDeb822Fd::PackageManagerProgressDeb822Fd(int progress_fd)
- : StepsDone(0), StepsTotal(1)
+ : d(NULL), StepsDone(0), StepsTotal(1)
{
OutStatusFd = progress_fd;
}
+PackageManagerProgressDeb822Fd::~PackageManagerProgressDeb822Fd() {}
void PackageManagerProgressDeb822Fd::WriteToStatusFd(std::string s)
{
@@ -233,7 +234,7 @@ bool PackageManagerProgressDeb822Fd::StatusChanged(std::string PackageName,
PackageManagerFancy::PackageManagerFancy()
- : child_pty(-1)
+ : d(NULL), child_pty(-1)
{
// setup terminal size
old_SIGWINCH = signal(SIGWINCH, PackageManagerFancy::staticSIGWINCH);
@@ -285,13 +286,13 @@ void PackageManagerFancy::SetupTerminalScrollArea(int nr_rows)
std::cout << "\n";
// save cursor
- std::cout << "\033[s";
+ std::cout << "\0337";
// set scroll region (this will place the cursor in the top left)
std::cout << "\033[0;" << nr_rows - 1 << "r";
// restore cursor but ensure its inside the scrolling area
- std::cout << "\033[u";
+ std::cout << "\0338";
static const char *move_cursor_up = "\033[1A";
std::cout << move_cursor_up;
@@ -373,8 +374,8 @@ bool PackageManagerFancy::DrawStatusLine()
if (unlikely(size.rows < 1 || size.columns < 1))
return false;
- static std::string save_cursor = "\033[s";
- static std::string restore_cursor = "\033[u";
+ static std::string save_cursor = "\0337";
+ static std::string restore_cursor = "\0338";
// green
static std::string set_bg_color = DeQuoteString(
@@ -433,6 +434,10 @@ bool PackageManagerText::StatusChanged(std::string PackageName,
return true;
}
+PackageManagerText::PackageManagerText() : PackageManager(), d(NULL) {}
+PackageManagerText::~PackageManagerText() {}
+
+
} // namespace progress