


#include "common.h"
#include <QSettings>
#include <QFileInfo>
#include <QDir>


QString GetPath(const QString &type)
{
    QSettings settings;
    QString path = settings.value(type, "").toString();
    if (path.isEmpty()) {
        // if not set, fallback to last check path hoping that it will be close enough
        path = settings.value(SETTINGS_LAST_CHECK_PATH, "").toString();
        if (path.isEmpty())
            // if not set, return user's home directory as the best we can do for now
            return QDir::homePath();
    }
    return path;
}

void SetPath(const QString &type, const QString &value)
{
    QSettings settings;
    settings.setValue(type, value);
}
