comparison src/hgrunner.cpp @ 663:f9b805d8cab4 qt5

build with qt5 (in branch currently)
author Chris Cannam
date Thu, 14 Mar 2013 16:43:30 +0000
parents ae67ea0af696
children 98a7fbbe9d88
comparison
equal deleted inserted replaced
662:43c61fd6fea4 663:f9b805d8cab4
20 #include "debug.h" 20 #include "debug.h"
21 #include "settingsdialog.h" 21 #include "settingsdialog.h"
22 22
23 #include <QSettings> 23 #include <QSettings>
24 #include <QInputDialog> 24 #include <QInputDialog>
25 #include <QDesktopServices> 25 #include <QStandardPaths>
26 #include <QTemporaryFile> 26 #include <QTemporaryFile>
27 #include <QDir> 27 #include <QDir>
28 #include <QProgressBar> 28 #include <QProgressBar>
29 #include <QPushButton> 29 #include <QPushButton>
30 #include <QGridLayout> 30 #include <QGridLayout>
452 startCommand(toRun); 452 startCommand(toRun);
453 } 453 }
454 454
455 void HgRunner::pruneOldAuthFiles() 455 void HgRunner::pruneOldAuthFiles()
456 { 456 {
457 QString path = QDesktopServices::storageLocation 457 QString path = QStandardPaths::writableLocation
458 (QDesktopServices::CacheLocation); 458 (QStandardPaths::CacheLocation);
459 QDir d(path); 459 QDir d(path);
460 if (!d.exists()) return; 460 if (!d.exists()) return;
461 QStringList filters; 461 QStringList filters;
462 filters << "easyhg.*.dat"; 462 filters << "easyhg.*.dat";
463 QStringList fl = d.entryList(filters); 463 QStringList fl = d.entryList(filters);
487 DEBUG << "HgRunner::addExtensionOptions: Failed to get proper auth file ext" << endl; 487 DEBUG << "HgRunner::addExtensionOptions: Failed to get proper auth file ext" << endl;
488 return ""; 488 return "";
489 } 489 }
490 QString fileExt16 = QString::fromLocal8Bit(fileExt.toBase64()).left(16) 490 QString fileExt16 = QString::fromLocal8Bit(fileExt.toBase64()).left(16)
491 .replace('+', '-').replace('/', '_'); 491 .replace('+', '-').replace('/', '_');
492 QString path = QDesktopServices::storageLocation 492 QString path = QStandardPaths::writableLocation
493 (QDesktopServices::CacheLocation); 493 (QStandardPaths::CacheLocation);
494 QDir().mkpath(path); 494 QDir().mkpath(path);
495 if (path == "") { 495 if (path == "") {
496 DEBUG << "HgRunner::addExtensionOptions: Failed to get cache location" << endl; 496 DEBUG << "HgRunner::addExtensionOptions: Failed to get cache location" << endl;
497 return ""; 497 return "";
498 } 498 }