SidebarGenerator adding GTA V Folder from Environment value

This commit is contained in:
Rafael 2016-04-10 22:35:41 +02:00
parent b1155cb2a7
commit de863c922a

View file

@ -18,6 +18,7 @@
#include "SidebarGenerator.h" #include "SidebarGenerator.h"
#include "StandardPaths.h" #include "StandardPaths.h"
#include "AppEnv.h"
#include <QList> #include <QList>
#include <QUrl> #include <QUrl>
#include <QDir> #include <QDir>
@ -40,11 +41,13 @@ QList<QUrl> SidebarGenerator::generateSidebarUrls(QList<QUrl> sidebarUrls)
dir.setPath(StandardPaths::documentsLocation()); dir.setPath(StandardPaths::documentsLocation());
if (dir.exists()) if (dir.exists())
{ {
sidebarUrls.append(QUrl::fromLocalFile(dir.absolutePath())); }
if (dir.cd("Rockstar Games/GTA V"))
{ bool gameFolderExists;
sidebarUrls << QUrl::fromLocalFile(dir.absolutePath()); QString gameFolder = AppEnv::getGameFolder(&gameFolderExists);
} if (gameFolderExists)
{
QUrl::fromLocalFile(gameFolder);
} }
dir.setPath(StandardPaths::desktopLocation()); dir.setPath(StandardPaths::desktopLocation());