this, SIGNAL(finishedLoadingTrace()));
m_saver = new SaverThread(this);
+ connect(m_saver, SIGNAL(traceSaved()),
+ this, SLOT(slotSaved()));
+ connect(m_saver, SIGNAL(traceSaved()),
+ this, SIGNAL(saved()));
}
ApiTrace::~ApiTrace()
if (!m_editedCalls.contains(call)) {
//lets generate a temp filename
QString tempPath = QDir::tempPath();
- //lets make sure it exists
m_tempFileName = QString::fromLatin1("%1/%2.edited")
.arg(tempPath)
.arg(m_fileName);
- m_needsSaving = true;
}
-
m_editedCalls.insert(call);
+ m_needsSaving = true;
emit changed(call);
}
{
QFileInfo fi(m_tempFileName);
QDir dir;
+ emit startedSaving();
dir.mkpath(fi.absolutePath());
+ m_saver->saveFile(m_tempFileName, m_calls);
+}
+
+void ApiTrace::slotSaved()
+{
m_needsSaving = false;
+}
- m_saver->saveFile(m_tempFileName, m_calls);
+bool ApiTrace::isSaving() const
+{
+ return m_saver->isRunning();
}
#include "apitrace.moc"