Limoo::Limoo(QObject *parent) : QObject(parent) { p = new LimooPrivate; p->viewer = 0; p->fullscreen = false; p->initialized = false; p->homePath = HOME_PATH; p->confPath = CONF_PATH; p->translator = new QTranslator(this); QIcon::setThemeName("FaenzaFlattr"); QDir().mkpath(p->homePath); p->settings = new QSettings(p->confPath,QSettings::IniFormat,this); p->fcrThumbnailBar = p->settings->value("General/fcrThumbnailBar",false).toBool(); p->nrmlThumbnailBar = p->settings->value("General/nrmlThumbnailBar",true).toBool(); p->highContrast = p->settings->value("General/highContrast",true).toBool(); p->highGamma = p->settings->value("General/highGamma",false).toBool(); p->highBright = p->settings->value("General/highBright",false).toBool(); qmlRegisterType<ImageMetaData>("org.sialan.limoo", 1, 0, "ImageMetaData"); qmlRegisterType<PathHandler>("org.sialan.limoo", 1, 0, "PathHandler"); init_languages(); }
TelegramGui::TelegramGui(QObject *parent) : QObject(parent) { p = new TelegramGuiPrivate; p->engine = 0; p->tg = 0; p->quit_state = false; p->args = QGuiApplication::arguments().first().toUtf8().data(); p->doc = new QTextDocument(this); p->translator = new QTranslator(this); QDir().mkpath(HOME_PATH); QDir().mkpath(HOME_PATH + "/downloads"); if( !tg_settings ) tg_settings = new QSettings( HOME_PATH + "/telegram.conf", QSettings::IniFormat, this); p->background = tg_settings->value( "General/background", QString() ).toString(); p->firstTime = tg_settings->value( "General/firstTime", true ).toBool(); p->width = tg_settings->value( "General/width", 1024 ).toInt(); p->height = tg_settings->value( "General/height", 600 ).toInt(); p->visible = tg_settings->value( "General/visible", true ).toBool(); p->notify = new Notification(this); connect( p->notify, SIGNAL(notifyAction(uint,QString)), SLOT(notify_action(uint,QString)) ); qmlRegisterType<Enums>("org.sialan.telegram", 1, 0, "Enums"); qmlRegisterType<SetObject>("org.sialan.telegram", 1, 0, "SetObject"); init_languages(); }
Cutegram::Cutegram(QObject *parent) : QObject(parent) { QFont default_font; #ifdef Q_OS_MAC default_font.setPointSize(9); #endif #ifdef Q_OS_WIN default_font.setPointSize(10); #endif p = new CutegramPrivate; p->defaultHostAddress = "149.154.167.50"; p->defaultHostPort = 443; p->defaultHostDcId = 2; p->appId = 13682; p->appHash = "de37bcf00f4688de900510f4f87384bb"; p->doc = new QTextDocument(this); p->desktop = new AsemanDesktopTools(this); p->sysTray = 0; p->unityTray = 0; p->sysTrayCounter = 0; p->closingState = false; p->highlightColor = AsemanApplication::settings()->value("General/lastHighlightColor", p->mainPalette.highlight().color().name() ).toString(); p->startupOption = AsemanApplication::settings()->value("General/startupOption", static_cast<int>(StartupAutomatic) ).toInt(); p->statusIconStyle = AsemanApplication::settings()->value("General/statusIconStyle", static_cast<int>(StatusIconAutomatic) ).toInt(); p->notification = AsemanApplication::settings()->value("General/notification", true ).toBool(); p->minimumDialogs = AsemanApplication::settings()->value("General/minimumDialogs", false ).toBool(); p->showLastMessage = AsemanApplication::settings()->value("General/showLastMessage", false ).toBool(); p->cutegramSubscribe = AsemanApplication::settings()->value("General/cutegramSubscribe", true ).toBool(); p->autoEmojis = AsemanApplication::settings()->value("General/autoEmojis", true ).toBool(); p->smoothScroll = AsemanApplication::settings()->value("General/smoothScroll", true ).toBool(); p->darkSystemTray = AsemanApplication::settings()->value("General/darkSystemTray", UNITY_LIGHT ).toBool(); p->background = AsemanApplication::settings()->value("General/background").toString(); p->masterColor = AsemanApplication::settings()->value("General/masterColor").toString(); p->messageAudio = AsemanApplication::settings()->value("General/messageAudio","files/new_msg.ogg").toString(); p->font = AsemanApplication::settings()->value("General/font", default_font).value<QFont>(); p->translator = new QTranslator(this); p->theme = AsemanApplication::settings()->value("General/theme","Abrisham.qml").toString(); p->searchEngine = AsemanApplication::settings()->value("General/searchEngine","https://duckduckgo.com/?q=").toString(); p->searchEngines = QStringList() << "https://duckduckgo.com/?q=" << "https://google.com/?q=" << "https://bing.com/?q="; #ifdef Q_OS_ANDROID p->close_blocker = true; p->translationsPath = "assets:/files/translations"; p->themesPath = "assets:/themes"; #else p->close_blocker = false; p->translationsPath = AsemanDevices::resourcePath() + "/files/translations/"; p->themesPath = AsemanDevices::resourcePath() + "/themes/"; #endif p->themes = QDir(p->themesPath).entryList( QStringList()<<"*.qml" ,QDir::Files, QDir::Name); QDir().mkpath(personalStickerDirectory()); qmlRegisterType<ContributorsModel>("Cutegram", 1, 0, "ContributorsModel"); qmlRegisterType<CutegramEnums>("Cutegram", 1, 0, "CutegramEnums"); qmlRegisterType<ThemeItem>("Cutegram", 1, 0, "CutegramTheme"); qmlRegisterType<TextEmojiWrapper>("Cutegram", 1, 0, "TextEmojiWrapper"); qmlRegisterType<Emojis>("Cutegram", 1, 0, "Emojis"); qmlRegisterType<EmoticonsModel>("Cutegram", 1, 0, "EmoticonsModel"); qmlRegisterType<CutegramDialog>("Cutegram", 1, 0, "CutegramDialog"); init_languages(); }