#
#
# delete "res/monkey_on_16x16.png"
#
# patch "guitone.pro"
# from [4cff513996bc63b4312d8af30f0d5a41be2dae96]
# to [b87a7840beaebee66e362affcc92d3521bdc6e63]
#
# patch "i18n/guitone_de.ts"
# from [6be3e2fa47d6c27f9251ae59f70d35cde5bd8afe]
# to [a900ab54923ef382eb4abdd0c891de86d7222b88]
#
# patch "src/model/IconProvider.cpp"
# from [6112b4df6ccc25ffdabb9ced7fe8fb148b2181da]
# to [d592eab5935e4e3c310d07276bdd34aae44d99ee]
#
# patch "src/model/IconProvider.h"
# from [ad472297ccdf1b6de1f0460ebbf83b82a6f3eeb7]
# to [514ff91ca3015e2285555dd3decf0e42207cad5e]
#
# patch "src/model/Monotone.cpp"
# from [4cc05b131cecb36322a3d7d429284b85a8bfd712]
# to [2e0022fd6cbfd817c79732f36fe587be707acef9]
#
# patch "src/model/Monotone.h"
# from [2d1520727dceebdf384cf8b6f93b44164917b119]
# to [3306459c13c76bf2bb5ddfb6c30ba16607f4b5fe]
#
# patch "src/model/ProxyModel.cpp"
# from [7b0da75db630ea4f85e1d2b77e666e20bd44479c]
# to [dbada65ccb1b618becbe252ea4d5f72d7298514d]
#
# patch "src/model/ProxyModel.h"
# from [2076d7cc7a45f1965beae2c23c9b3a22912eaab6]
# to [f8cc3edc262e6b6b3f0444723c6dd4698aa1d6a1]
#
# patch "src/model/Workspace.cpp"
# from [7175a148c6137c97a41f4fa210e1e6782ea250e3]
# to [71359dde2f05e2f6ed7d2a9198b565f8993e4f83]
#
# patch "src/model/WorkspaceItem.cpp"
# from [aa03e0d283226c4a0c5ce01c5c474084b31aae4c]
# to [4d13f4a1c882172f952c01326960bcf8e1ccc991]
#
# patch "src/stable.h"
# from [6be564f3b1a5223104450daf8e28e5111d82042d]
# to [156b68c2371359c998ada42cee2aa33d68046132]
#
# patch "src/view/Guitone.cpp"
# from [2ae731a3f3d484a6f40ba8b8ca0ac778b8f94943]
# to [cec9aa01303fe91e5619f5cdf5e3570c3985f212]
#
# patch "src/view/Guitone.h"
# from [a98636d06c384e82e671b09ae011696f03b6c44c]
# to [b045f88f34fec2d40cd70df6b5ae8d3fdd692a1d]
#
# patch "src/view/WorkspaceView.cpp"
# from [16cc1101bfbf4997b2c1aa96861803b5653162ef]
# to [da3f96d45b48d1decd6dcc98d3e68e7504a875f6]
#
# patch "src/view/WorkspaceView.h"
# from [f9ddf6c3ccfc484353c49b82b8e948da760fa54b]
# to [425b7e0bb87fe2d50b6fdc51bcf40f7921a85f18]
#
============================================================
--- guitone.pro 4cff513996bc63b4312d8af30f0d5a41be2dae96
+++ guitone.pro b87a7840beaebee66e362affcc92d3521bdc6e63
@@ -20,7 +20,6 @@
OBJECTS_DIR = tmp
MOC_DIR = tmp
DESTDIR = bin
-QT += qt3support
TRANSLATIONS = i18n/guitone_de.ts
RESOURCES = res/guitone.qrc
RCC_DIR = tmp
============================================================
--- i18n/guitone_de.ts 6be3e2fa47d6c27f9251ae59f70d35cde5bd8afe
+++ i18n/guitone_de.ts a900ab54923ef382eb4abdd0c891de86d7222b88
@@ -69,7 +69,7 @@
-
+ Kritischer monotone-Fehler
@@ -99,12 +99,12 @@
Konnte den monotone-Prozess nicht starten (ProcessError %1). Ist das Programm korrekt installiert?
-
-
+
+ Die Verbindung zum monotone-Prozess wurde beendet (Code %1).
-
-
+
+ Monotone konnte nicht gestartet werden (Code %1). Ist das Programm korrekt installiert?
============================================================
--- src/model/IconProvider.cpp 6112b4df6ccc25ffdabb9ced7fe8fb148b2181da
+++ src/model/IconProvider.cpp d592eab5935e4e3c310d07276bdd34aae44d99ee
@@ -27,19 +27,28 @@
iconDirUnchanged = new QIcon();
iconDirChanged = new QIcon();
iconDirUnknown = new QIcon();
+ iconDirIgnored = new QIcon();
+ iconFileNormal = new QIcon();
QStyle *style = QApplication::style();
iconDirUnchanged->addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon));
- iconDirUnchanged->addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Normal, QIcon::On);
+ iconDirUnchanged->addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Active, QIcon::On);
iconDirChanged->addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon));
- iconDirChanged->addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Normal, QIcon::On);
+ iconDirChanged->addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Active, QIcon::On);
iconDirUnknown->addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon));
- iconDirUnknown->addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Normal, QIcon::On);
+ iconDirUnknown->addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Active, QIcon::On);
+ iconDirIgnored->addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon));
+ iconDirIgnored->addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Active, QIcon::On);
+
+ iconFileNormal->addPixmap(style->standardPixmap(QStyle::SP_FileIcon));
}
IconProvider::~IconProvider(void)
{
delete iconDirUnchanged;
delete iconDirChanged;
+ delete iconDirUnknown;
+ delete iconDirIgnored;
+ delete iconFileNormal;
}
QIcon IconProvider::getIcon(WorkspaceItem* item)
@@ -58,10 +67,15 @@
{
return *iconDirUnknown;
}
+ else if(item->hasStatus(WorkspaceItem::Ignored))
+ {
+ return *iconDirIgnored;
+ }
+ // TODO: missing icon states: renamed from/to, added, dropped
+ return *iconDirUnknown;
}
- // TODO: Provide more icons for the differnt states
-
- return QIcon(":/monkey_on_16x16.png");
+ // TODO: icon states of files...
+ return *iconFileNormal;
}
============================================================
--- src/model/IconProvider.h ad472297ccdf1b6de1f0460ebbf83b82a6f3eeb7
+++ src/model/IconProvider.h 514ff91ca3015e2285555dd3decf0e42207cad5e
@@ -35,6 +35,8 @@
QIcon *iconDirUnchanged;
QIcon *iconDirChanged;
QIcon *iconDirUnknown;
+ QIcon *iconDirIgnored;
+ QIcon *iconFileNormal;
};
#endif
============================================================
--- src/model/Monotone.cpp 4cc05b131cecb36322a3d7d429284b85a8bfd712
+++ src/model/Monotone.cpp 2e0022fd6cbfd817c79732f36fe587be707acef9
@@ -24,13 +24,25 @@
Monotone::Monotone(QObject * parent) : QObject(parent), process(0)
{
+ // true if a command is currently processed
isProcessingData = false;
+ // true if the process is destroyed in the destructor
+ isCleanExit = false;
output = new QStringList();
}
void Monotone::setup(QDir *workingDirectory)
{
- if (process) { delete process; process = 0; }
+ if (process)
+ {
+ isCleanExit = true;
+ // terminate any running process
+ process->terminate();
+ qDebug("Calling waitForFinished");
+ // block until the process has really been finished
+ process->waitForFinished();
+ qDebug("Process finished");
+ }
process = new QProcess(this);
@@ -67,10 +79,9 @@
Monotone::~Monotone()
{
- // terminate any running process
- process->terminate();
- delete process;
- process = 0;
+ isCleanExit = true;
+ delete process;
+ process = 0;
}
Monotone* Monotone::singleton(QObject * parent)
@@ -80,17 +91,17 @@
return instance;
}
-void Monotone::startupError(QProcess::ProcessError /* error */)
+void Monotone::startupError(QProcess::ProcessError error)
{
- emit criticalError(tr("Monotone failed to start. Have you installed it properly?"));
+ if (isCleanExit) return;
+ emit criticalError(tr("Monotone failed to start (Code %1). Have you installed it properly?").arg(error));
}
void Monotone::processTerminated(int code, QProcess::ExitStatus /* status */)
{
// this was a normal exit
- if (code == 0) return;
-
- emit criticalError(tr("The connection to the monotone process was terminated."));
+ if (code == 0 || isCleanExit) return;
+ emit criticalError(tr("The connection to the monotone process was terminated (Code %1).").arg(code));
}
bool Monotone::triggerCommand(QString cmd)
@@ -115,7 +126,7 @@
output->clear();
QString finalCmd;
- QStringList parts = QStringList::split(' ', cmd);
+ QStringList parts = cmd.split(' ');
// a command starts with a lowercase L
finalCmd += "l";
@@ -131,7 +142,7 @@
// finally, the cmd ends with "e\n"
finalCmd += "e\n";
- qDebug("Final command: %s", finalCmd.latin1());
+ qDebug("Final command: %s", qPrintable(finalCmd));
// QProcess in QT4 dosen't have a writeToStdin().
// So we need the following QTextStream
@@ -153,7 +164,7 @@
QString temp(byteArray);
// splits the input into lines
- QStringList inputList = QStringList::split("\n", temp);
+ QStringList inputList = temp.split("\n");
QString lineFromStdIn("");
@@ -162,9 +173,9 @@
for (QStringList::Iterator it = inputList.begin(); it != inputList.end(); ++it )
{
lineFromStdIn = *it;
- if (regex.search(lineFromStdIn) == -1)
+ if (regex.indexIn(lineFromStdIn) == -1)
{
- qWarning("Monotone::parseLineFromStdout: Can't parse data %s", lineFromStdIn.latin1());
+ qWarning("Monotone::parseLineFromStdout: Can't parse data %s", qPrintable(lineFromStdIn));
continue;
}
QStringList list = regex.capturedTexts();
============================================================
--- src/model/Monotone.h 2d1520727dceebdf384cf8b6f93b44164917b119
+++ src/model/Monotone.h 3306459c13c76bf2bb5ddfb6c30ba16607f4b5fe
@@ -47,6 +47,7 @@
private:
QStringList *output;
bool isProcessingData;
+ bool isCleanExit;
static Monotone* instance;
QProcess * process;
============================================================
--- src/model/ProxyModel.cpp 7b0da75db630ea4f85e1d2b77e666e20bd44479c
+++ src/model/ProxyModel.cpp dbada65ccb1b618becbe252ea4d5f72d7298514d
@@ -36,21 +36,15 @@
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
WorkspaceItem *item = static_cast(index.internalPointer());
- if(folderTree)
+ if (folderTree)
{
if(item->isDirectory())
{
- return true;
+ return true;
}
- else
- {
- return false;
- }
+ return false;
}
- else
- {
- return true;
- }
+ return true;
}
bool ProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
@@ -59,23 +53,21 @@
WorkspaceItem *itemLeft = static_cast(left.internalPointer());
WorkspaceItem *itemRight = static_cast(right.internalPointer());
- if(itemLeft->isDirectory() && itemRight->isDirectory())
+ if (itemLeft->isDirectory() && itemRight->isDirectory())
{
return itemLeft->getFilename() < itemRight->getFilename();
}
- if(!itemLeft->isDirectory() && !itemRight->isDirectory())
+ if (!itemLeft->isDirectory() && !itemRight->isDirectory())
{
return itemLeft->getFilename() < itemRight->getFilename();
}
- if(itemLeft->isDirectory() && !itemRight->isDirectory())
+ if (itemLeft->isDirectory() && !itemRight->isDirectory())
{
return true;
}
- if(!itemLeft->isDirectory() && itemRight->isDirectory())
- {
- return false;
- }
+ // last case: !itemLeft->isDirectory() && itemRight->isDirectory()
+ return false;
}
============================================================
--- src/model/ProxyModel.h 2076d7cc7a45f1965beae2c23c9b3a22912eaab6
+++ src/model/ProxyModel.h f8cc3edc262e6b6b3f0444723c6dd4698aa1d6a1
============================================================
--- src/model/Workspace.cpp 7175a148c6137c97a41f4fa210e1e6782ea250e3
+++ src/model/Workspace.cpp 71359dde2f05e2f6ed7d2a9198b565f8993e4f83
@@ -30,6 +30,7 @@
// in the model, otherwise the app crashes
rootItem = new WorkspaceItem();
iconProvider = new IconProvider();
+ monotone = 0;
}
Workspace::~Workspace()
@@ -45,7 +46,7 @@
workspaceDir = new QDir(workspace);
if (!workspaceDir->exists())
{
- qWarning("Cannot find directory " + workspace);
+ qWarning("Cannot find directory %s", qPrintable(workspace));
return false;
}
@@ -58,7 +59,7 @@
}
while (!workspaceDir->isRoot() && workspaceDir->cdUp());
- qWarning("Cannot find _MTN directory in or above "+ workspace);
+ qWarning("Cannot find _MTN directory in or above %s", qPrintable(workspace));
return false;
}
@@ -67,6 +68,7 @@
// enable the wait cursor
qApp->setOverrideCursor(Qt::WaitCursor);
+ // grab the Monotone wrapper instance
monotone = Monotone::singleton();
connect(
@@ -74,6 +76,7 @@
this, SLOT(parseInventory(int))
);
+ // setup a new process instance with a new working directory
monotone->setup(workspaceDir);
return monotone->triggerCommand("inventory");
@@ -87,7 +90,7 @@
if ((returnCode > 0) && (!output->isEmpty()))
{
QString error = output->front();
- qWarning("A error occured: %s", error.latin1());
+ qWarning("A error occured: %s", qPrintable(error));
// restore the normal cursor
qApp->restoreOverrideCursor();
return;
@@ -111,9 +114,9 @@
for (QStringList::Iterator it = output->begin(); it != output->end(); ++it)
{
- if (regex.search(*it) == -1)
+ if (regex.indexIn(*it) == -1)
{
- qWarning("Couldn't parse inventory line %s", (*it).latin1());
+ qWarning("Couldn't parse inventory line %s", qPrintable(*it));
continue;
}
QStringList list = regex.capturedTexts();
@@ -132,7 +135,7 @@
{
if (list[1].compare(" ") != 0)
{
- qWarning("Unknown status first tripel " + list[1]);
+ qWarning("Unknown status first tripel %s", qPrintable(list[1]));
}
}
@@ -149,7 +152,7 @@
{
if (list[2].compare(" ") != 0)
{
- qWarning("Unknown status second tripel " + list[2]);
+ qWarning("Unknown status second tripel %s", qPrintable(list[2]));
}
}
@@ -199,14 +202,6 @@
renameMap[to_id] = item;
}
- // Display the item properties
- //qDebug("Item: Name %s, PATH %s, Status %s, IsDir %d",
- // item->getFilename().trimmed().latin1(),
- // item->getPath().trimmed().latin1(),
- // item->statusString().trimmed().latin1(),
- // item->isDirectory()
- // );
-
tempItems.push_back(item);
}
============================================================
--- src/model/WorkspaceItem.cpp aa03e0d283226c4a0c5ce01c5c474084b31aae4c
+++ src/model/WorkspaceItem.cpp 4d13f4a1c882172f952c01326960bcf8e1ccc991
@@ -170,7 +170,7 @@
QString WorkspaceItem::getFilename() const
{
- int pos = path.findRev('/');
+ int pos = path.lastIndexOf('/');
return pos == -1 ? path : path.right(path.length() - pos - 1);
}
============================================================
--- src/stable.h 6be564f3b1a5223104450daf8e28e5111d82042d
+++ src/stable.h 156b68c2371359c998ada42cee2aa33d68046132
@@ -40,9 +40,11 @@
#include
#include
#include
+#include
#include
#include
#include
+
// Other lib includes
#include