20 #include "../../../cpp_simptshell/workspace/util/Compressor.h"
34 Compressor::Compressor(
const string& path)
37 m_a_compress =
new QAction(
"Compress",
this);
38 m_a_decompress =
new QAction(
"Decompress",
this);
40 connect(m_a_compress, SIGNAL(triggered()),
this, SLOT(SLOT_Compress()));
41 connect(m_a_decompress, SIGNAL(triggered()),
this, SLOT(SLOT_Decompress()));
44 QAction* Compressor::GetActionCompress()
const
49 QAction* Compressor::GetActionDecompress()
const
51 return m_a_decompress;
54 void Compressor::SLOT_Compress()
56 string new_path = m_path +
".gz";
57 PTreeFile::Compress(m_path, new_path);
60 QFile::remove(QString::fromStdString(m_path));
63 void Compressor::SLOT_Decompress()
65 string new_path = m_path.substr(0, m_path.length()-3);
66 PTreeFile::Decompress(m_path, new_path);
69 QFile::remove(QString::fromStdString(m_path));
Namespace for miscellaneous utilities.
Namespace for SimPT shell package.