~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to src/util/settings.cpp

  • Committer: Nathan Osman
  • Date: 2012-06-27 21:56:40 UTC
  • Revision ID: admin@quickmediasolutions.com-20120627215640-c6mspvllk1br9vx2
Implemented basic progress bar for uploads (which seems to be broken at the moment) and corrected a bug with the way unique IDs were generated for each machine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <QDir>
19
19
#include <QFile>
20
20
#include <QSettings>
 
21
#include <QUuid>
21
22
 
22
23
#include <util/defaults.h>
23
24
#include <util/settings.h>
42
43
    return Get("Notifications/" + type).toBool();
43
44
}
44
45
 
 
46
QString Settings::GetID()
 
47
{
 
48
    QSettings settings;
 
49
 
 
50
    /* If there is an exisiting ID, return it. */
 
51
    if(settings.contains("Internal/ID"))
 
52
        return settings.value("Internal/ID").toString();
 
53
 
 
54
    /* Otherwise we need to generate one and store it. */
 
55
    QString uuid = QUuid::createUuid().toString();
 
56
    settings.setValue("Internal/ID", uuid);
 
57
    return uuid;
 
58
}
 
59
 
45
60
#ifdef Q_OS_LINUX
46
61
QDir GetStartupDir()
47
62
{