bool WeatherApplicationExtension::initialize(const QString &){ QGraphicsObject* mWidget; box = new MyMWidget(); /* D-BUS */ new MeecastIf(box); QDBusConnection connection = QDBusConnection::sessionBus(); bool ret = connection.registerService("com.meecast.applet"); ret = connection.registerObject("/com/meecast/applet", box); EventFeedIf* client = new EventFeedIf("com.nokia.home.EventFeed", "/eventfeed", QDBusConnection::sessionBus(), 0); QObject::connect(client, SIGNAL(refreshRequested()), box, SLOT(refreshRequested())); QTimer::singleShot(1000, box, SLOT(refreshRequested())); /* Copy wallpaper */ if (!(QFile::exists("/home/user/.cache/com.meecast.omweather/wallpaper_MeeCast_original.png"))){ QDir dir("/home/user/.cache/com.meecast.omweather"); if (!dir.exists()) dir.mkpath("/home/user/.cache/com.meecast.omweather"); MGConfItem *wallpaperItem; wallpaperItem = new MGConfItem ("/desktop/meego/background/portrait/picture_filename"); if (QFile::exists(wallpaperItem->value().toString())) QFile::copy(wallpaperItem->value().toString(), "/home/user/.cache/com.meecast.omweather/wallpaper_MeeCast_original.png"); } // box->startpredeamon(); return true; }
/*! * Reads the PSMAuto value, a boolean that sets if the device should go into * power save mode automatically. This method is only reads the GConf database. */ bool BatteryBusinessLogic::PSMAutoValue () { MGConfItem PSMAutoKey (psm_auto_key); SYS_DEBUG ("value = %s", SYS_BOOL (PSMAutoKey.value ().toBool ())); return PSMAutoKey.value ().toBool (); }
SocamFSWidget::SocamFSWidget (QGraphicsWidget *parent) : DcpWidget (parent), m_logic (0), m_MainLayout (0), m_TitleLabel (0), m_SubTitleLabel (0), m_logLevelsCBox (0) { setReferer (DcpDisplay::None); setContentsMargins (0, 0, 0, 0); m_logic = new SocamFSBusinessLogic; /* * Lets have these configurable via gconf keys */ MGConfItem eggs(EGGS_GCONF_KEY); if (eggs.value().toBool()) { m_topCloseChangeable = true; } else { MGConfItem tcs ("/meegotouch/settings/top_swipe_switchable"); m_topCloseChangeable = tcs.value (false).toBool (); } initWidget (); }
QString Wallpaper::logicalIdToFilePath ( const QString &id) { QString retval = id; if (!id.isEmpty() && !id.startsWith (QDir::separator())) { MGConfItem themeItem (Wallpaper::themeNameKey); QString themeName = themeItem.value().toString(); retval = Wallpaper::themeImagePath.arg(themeName).arg(id); } SYS_DEBUG ("Returning '%s'", SYS_STR(retval)); return retval; }
int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app (SailfishApp::application(argc, argv)); QScopedPointer<QQuickView> view (SailfishApp::createView()); MGConfItem partnerSpaceQml (PARTNERSPACEMANAGER_QML_DCONF); QString qmlFile = partnerSpaceQml.value(QString()).toString(); if (qmlFile.isEmpty()) { return 1; } qDebug() << "Running partner-space launcher with" << qmlFile; view->setSource(QUrl(qmlFile)); // The view is a partner window view->create(); QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); native->setWindowProperty(view->handle(), QLatin1String("CATEGORY"), QString(QLatin1String("partner"))); view->show(); return app->exec(); }
/*! * Reads the PSMAuto value, a boolean that sets if the device should go into * power save mode automatically. This method is only reads the GConf database. */ bool BatteryBusinessLogic::PSMAutoValue () { MGConfItem PSMAutoKey (psm_auto_key); return PSMAutoKey.value ().toBool (); }