Merge pull request #1378 from murillodigital/master

Displaying build number in title and using proper cache path
This commit is contained in:
Stephen Birarda 2013-12-16 12:01:26 -08:00
commit 4e618fc307

View file

@ -218,9 +218,11 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
connect(silentNodeTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes())); connect(silentNodeTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes()));
silentNodeTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000); silentNodeTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000);
QString cachePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
_networkAccessManager = new QNetworkAccessManager(this); _networkAccessManager = new QNetworkAccessManager(this);
QNetworkDiskCache* cache = new QNetworkDiskCache(_networkAccessManager); QNetworkDiskCache* cache = new QNetworkDiskCache(_networkAccessManager);
cache->setCacheDirectory("interfaceCache"); cache->setCacheDirectory(!cachePath.isEmpty() ? cachePath : "interfaceCache");
_networkAccessManager->setCache(cache); _networkAccessManager->setCache(cache);
_window->setCentralWidget(_glWidget); _window->setCentralWidget(_glWidget);
@ -4106,12 +4108,14 @@ void Application::attachNewHeadToNode(Node* newNode) {
void Application::updateWindowTitle(){ void Application::updateWindowTitle(){
QString title = ""; QString title = "";
QString buildVersion = " (build " + QString::number(BUILD_VERSION) + ")";
QString username = _profile.getUsername(); QString username = _profile.getUsername();
if(!username.isEmpty()){ if(!username.isEmpty()){
title += _profile.getUsername(); title += _profile.getUsername();
title += " @ "; title += " @ ";
} }
title += _profile.getLastDomain(); title += _profile.getLastDomain();
title += buildVersion;
qDebug("Application title set to: %s.\n", title.toStdString().c_str()); qDebug("Application title set to: %s.\n", title.toStdString().c_str());
_window->setWindowTitle(title); _window->setWindowTitle(title);