If the RR trace directory isn't given, try a couple standard places. · epasveer/seer@286ad66 (original) (raw)
`@@ -7,6 +7,7 @@
`
7
7
`#include "SeerDirectoryFilterProxyModel.h"
`
8
8
`#include "SeerSlashProcDialog.h"
`
9
9
`#include "SeerHelpPageDialog.h"
`
``
10
`+
#include "SeerUtl.h"
`
10
11
`#include "QHContainerWidget.h"
`
11
12
`#include <QtWidgets/QFileDialog>
`
12
13
`#include <QtWidgets/QMessageBox>
`
`@@ -916,6 +917,30 @@ void SeerDebugDialog::handleRunModeChanged (int id) {
`
916
917
` executableSymbolNameToolButton->setEnabled(true);
`
917
918
` preCommandsPlainTextEdit->setPlaceholderText("gdb commands before "RR trace-directory load"");
`
918
919
` postCommandsPlainTextEdit->setPlaceholderText("gdb commands after "RR trace-directory load"");
`
``
920
+
``
921
`+
// Set default if we can. Otherwise, leave it blank.
`
``
922
`+
//
`
``
923
`+
if (rrTraceDirectoryLineEdit->text() == "") {
`
``
924
`+
QStringList searchPaths = {
`
``
925
`+
"$_RR_TRACE_DIR/latest-trace",
`
``
926
`+
"$XDG_DATA_HOME/rr/latest-trace",
`
``
927
`+
"$HOME/.local/share/rr/latest-trace"
`
``
928
`+
};
`
``
929
+
``
930
`+
QString defaultPath = "";
`
``
931
`+
bool f;
`
``
932
+
``
933
`+
for (const auto& path : searchPaths) {
`
``
934
`+
defaultPath = Seer::expandEnv(path, &f);
`
``
935
`+
if (f == false) {
`
``
936
`+
continue;
`
``
937
`+
}
`
``
938
`+
if (QFile::exists(defaultPath)) {
`
``
939
`+
setRRTraceDirectory(defaultPath);
`
``
940
`+
break;
`
``
941
`+
}
`
``
942
`+
}
`
``
943
`+
}
`
919
944
` }
`
920
945
``
921
946
`// ID == 4 COREFILE
`