~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to src/util/defaults.cpp

  • Committer: Nathan Osman
  • Date: 2012-06-30 18:21:50 UTC
  • Revision ID: admin@quickmediasolutions.com-20120630182150-avavhqs8km192915
New share boxes are now properly positioned when added to the desktop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <QDesktopServices>
19
19
#include <QDesktopWidget>
20
20
#include <QHostInfo>
21
 
#include <QPoint>
22
21
#include <QVariantList>
23
22
 
24
23
#include <sharebox/CShareBox.h>
27
26
 
28
27
QVariantMap Defaults::Map;
29
28
 
30
 
QVariant GenerateDefaultShareBoxInstance()
 
29
QPoint Defaults::GetDefaultShareBoxPos()
31
30
{
32
31
    /* Get the dimensions of the primary screen. */
33
32
    QDesktopWidget * desktop = QApplication::desktop();
41
40
    pos /= 10;
42
41
    pos *= 10;
43
42
 
 
43
    return pos;
 
44
}
 
45
 
 
46
QVariant GenerateDefaultShareBoxInstance()
 
47
{
44
48
    /* Generate the map/list that we will return. */
45
49
    QVariantMap map;
46
 
    map["pos"] = pos;
 
50
    map["pos"] = Defaults::GetDefaultShareBoxPos();
47
51
 
48
52
    QVariantList list;
49
53
    list << map;