Prevent scanning of workspaces when we don't have a valid path
Fixed invalid access in stash parsing FossilOrigin-Name: c346118e744ae9d9c397194a7aa29f42256d76db
This commit is contained in:
parent
dbaf78d164
commit
3310e82765
@ -174,7 +174,7 @@ MainWindow::MainWindow(QWidget *parent, QString *workspacePath) :
|
|||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
// Apply any explict workspace path if available
|
// Apply any explict workspace path if available
|
||||||
if(workspacePath)
|
if(workspacePath && !workspacePath->isEmpty())
|
||||||
openWorkspace(*workspacePath);
|
openWorkspace(*workspacePath);
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
@ -540,6 +540,9 @@ void MainWindow::scanWorkspace()
|
|||||||
QFileInfoList all_files;
|
QFileInfoList all_files;
|
||||||
QString wkdir = getCurrentWorkspace();
|
QString wkdir = getCurrentWorkspace();
|
||||||
|
|
||||||
|
if(wkdir.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
// Retrieve the status of files tracked by fossil
|
// Retrieve the status of files tracked by fossil
|
||||||
QStringList res;
|
QStringList res;
|
||||||
if(!runFossil(QStringList() << "ls" << "-l", &res, RUNGLAGS_SILENT_ALL))
|
if(!runFossil(QStringList() << "ls" << "-l", &res, RUNGLAGS_SILENT_ALL))
|
||||||
@ -667,7 +670,7 @@ void MainWindow::scanWorkspace()
|
|||||||
// 19: [5c46757d4b9765] on 2012-04-22 04:41:15
|
// 19: [5c46757d4b9765] on 2012-04-22 04:41:15
|
||||||
QRegExp stash_rx("\\s*(\\d+):\\s+\\[(.*)\\] on (\\d+)-(\\d+)-(\\d+) (\\d+):(\\d+):(\\d+)", Qt::CaseInsensitive);
|
QRegExp stash_rx("\\s*(\\d+):\\s+\\[(.*)\\] on (\\d+)-(\\d+)-(\\d+) (\\d+):(\\d+):(\\d+)", Qt::CaseInsensitive);
|
||||||
|
|
||||||
for(QStringList::iterator line_it=res.begin(); line_it!=res.end();)
|
for(QStringList::iterator line_it=res.begin(); line_it!=res.end(); )
|
||||||
{
|
{
|
||||||
QString line = *line_it;
|
QString line = *line_it;
|
||||||
|
|
||||||
@ -676,20 +679,15 @@ void MainWindow::scanWorkspace()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
QString id = stash_rx.cap(1);
|
QString id = stash_rx.cap(1);
|
||||||
|
|
||||||
// Parse stash name
|
|
||||||
++line_it;
|
++line_it;
|
||||||
line = *line_it;
|
|
||||||
|
|
||||||
// Named stash
|
|
||||||
QString name;
|
QString name;
|
||||||
// Finish at an anonymous stash or start of a new stash
|
// Finish at an anonymous stash or start of a new stash ?
|
||||||
if(line_it==res.end() || stash_rx.indexIn(line)!=-1)
|
if(line_it==res.end() || stash_rx.indexIn(*line_it)!=-1)
|
||||||
{
|
name = line.trimmed();
|
||||||
name = tr("Stash %1").arg(id);
|
else // Named stash
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
// Parse stash name
|
||||||
name = (*line_it);
|
name = (*line_it);
|
||||||
name = name.trimmed();
|
name = name.trimmed();
|
||||||
++line_it;
|
++line_it;
|
||||||
|
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
|||||||
C Increased\srobustness\sin\sthe\sstash\sparsing\n
|
C Prevent\sscanning\sof\sworkspaces\swhen\swe\sdon't\shave\sa\svalid\spath\nFixed\sinvalid\saccess\sin\sstash\sparsing
|
||||||
D 2012-04-22T05:57:52.133
|
D 2012-04-22T06:38:43.118
|
||||||
F CommitDialog.cpp a46020a9361151d8d286a2670257d01d8967bf69
|
F CommitDialog.cpp a46020a9361151d8d286a2670257d01d8967bf69
|
||||||
F CommitDialog.h f1ee8db92103164e7db55a8407ccdcff24571b72
|
F CommitDialog.h f1ee8db92103164e7db55a8407ccdcff24571b72
|
||||||
F CommitDialog.ui 813d7cba316e226de1a22b7e480bb969fbe9b0c4
|
F CommitDialog.ui 813d7cba316e226de1a22b7e480bb969fbe9b0c4
|
||||||
@ -8,7 +8,7 @@ F FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce
|
|||||||
F FileActionDialog.ui c63644428579741aeb5fa052e237ba799ced9ad7
|
F FileActionDialog.ui c63644428579741aeb5fa052e237ba799ced9ad7
|
||||||
F FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
F FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
||||||
F FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
F FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
||||||
F MainWindow.cpp 865788d994bc7c132e8a2dc0ff8893bcf0230081
|
F MainWindow.cpp 63f43be93e02d1d962c8ccc48f0636f650eb0107
|
||||||
F MainWindow.h 78dc49fe4500a6113ed8bbff597d5305d203a80c
|
F MainWindow.h 78dc49fe4500a6113ed8bbff597d5305d203a80c
|
||||||
F MainWindow.ui d569997fecf4a22d61a016a4a23eea04eaad6dee
|
F MainWindow.ui d569997fecf4a22d61a016a4a23eea04eaad6dee
|
||||||
F SettingsDialog.cpp e1fad18cc020d08b82c6d35dc94f6624deec9a3b
|
F SettingsDialog.cpp e1fad18cc020d08b82c6d35dc94f6624deec9a3b
|
||||||
@ -176,7 +176,7 @@ F installer/fuel.iss 13b6a938bcdf273cbd3649d2549887baa1577214
|
|||||||
F installer/license.txt 4cc77b90af91e615a64ae04893fdffa7939db84c
|
F installer/license.txt 4cc77b90af91e615a64ae04893fdffa7939db84c
|
||||||
F main.cpp 69c1f9e873c016ef466d20298a67c3bc4c2b2f3a
|
F main.cpp 69c1f9e873c016ef466d20298a67c3bc4c2b2f3a
|
||||||
F resources.qrc e98383ed205f4e37100c60057e0129c3b86dea53
|
F resources.qrc e98383ed205f4e37100c60057e0129c3b86dea53
|
||||||
P e42f476b1c07959ee224b1abbd60f811893d0717
|
P ce3816871d40d08821944aa58329baf993fcb688
|
||||||
R f3af307696f374c7ed861ac0ac8da9ef
|
R a76899b07d39493ca860fc54fea19753
|
||||||
U kostas
|
U kostas
|
||||||
Z a39a161794cfc1b645b89f5c61f2466d
|
Z 22648ec8a9e0699bb52539c8c454dde9
|
||||||
|
@ -1 +1 @@
|
|||||||
ce3816871d40d08821944aa58329baf993fcb688
|
c346118e744ae9d9c397194a7aa29f42256d76db
|
Loading…
x
Reference in New Issue
Block a user