本文整理汇总了C++中Preferences::getFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ Preferences::getFilter方法的具体用法?C++ Preferences::getFilter怎么用?C++ Preferences::getFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preferences
的用法示例。
在下文中一共展示了Preferences::getFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPreferences
QByteArray prefjson::getPreferences()
{
const Preferences pref;
QVariantMap data;
// UI
data["locale"] = pref.getLocale();
// Downloads
data["save_path"] = fsutils::toNativePath(pref.getSavePath());
data["temp_path_enabled"] = pref.isTempPathEnabled();
data["temp_path"] = fsutils::toNativePath(pref.getTempPath());
QVariantList l;
foreach (const QString& s, pref.getScanDirs()) {
l << fsutils::toNativePath(s);
}
data["scan_dirs"] = l;
QVariantList var_list;
foreach (bool b, pref.getDownloadInScanDirs()) {
var_list << b;
}
data["download_in_scan_dirs"] = var_list;
data["export_dir_enabled"] = pref.isTorrentExportEnabled();
data["export_dir"] = fsutils::toNativePath(pref.getTorrentExportDir());
data["mail_notification_enabled"] = pref.isMailNotificationEnabled();
data["mail_notification_email"] = pref.getMailNotificationEmail();
data["mail_notification_smtp"] = pref.getMailNotificationSMTP();
data["mail_notification_ssl_enabled"] = pref.getMailNotificationSMTPSSL();
data["mail_notification_auth_enabled"] = pref.getMailNotificationSMTPAuth();
data["mail_notification_username"] = pref.getMailNotificationSMTPUsername();
data["mail_notification_password"] = pref.getMailNotificationSMTPPassword();
data["autorun_enabled"] = pref.isAutoRunEnabled();
data["autorun_program"] = fsutils::toNativePath(pref.getAutoRunProgram());
data["preallocate_all"] = pref.preAllocateAllFiles();
data["queueing_enabled"] = pref.isQueueingSystemEnabled();
data["max_active_downloads"] = pref.getMaxActiveDownloads();
data["max_active_torrents"] = pref.getMaxActiveTorrents();
data["max_active_uploads"] = pref.getMaxActiveUploads();
data["dont_count_slow_torrents"] = pref.ignoreSlowTorrentsForQueueing();
data["incomplete_files_ext"] = pref.useIncompleteFilesExtension();
// Connection
data["listen_port"] = pref.getSessionPort();
data["upnp"] = pref.isUPnPEnabled();
data["dl_limit"] = pref.getGlobalDownloadLimit();
data["up_limit"] = pref.getGlobalUploadLimit();
data["max_connec"] = pref.getMaxConnecs();
data["max_connec_per_torrent"] = pref.getMaxConnecsPerTorrent();
data["max_uploads_per_torrent"] = pref.getMaxUploadsPerTorrent();
data["enable_utp"] = pref.isuTPEnabled();
data["limit_utp_rate"] = pref.isuTPRateLimited();
data["limit_tcp_overhead"] = pref.includeOverheadInLimits();
data["alt_dl_limit"] = pref.getAltGlobalDownloadLimit();
data["alt_up_limit"] = pref.getAltGlobalUploadLimit();
data["scheduler_enabled"] = pref.isSchedulerEnabled();
const QTime start_time = pref.getSchedulerStartTime();
data["schedule_from_hour"] = start_time.hour();
data["schedule_from_min"] = start_time.minute();
const QTime end_time = pref.getSchedulerEndTime();
data["schedule_to_hour"] = end_time.hour();
data["schedule_to_min"] = end_time.minute();
data["scheduler_days"] = pref.getSchedulerDays();
// Bittorrent
data["dht"] = pref.isDHTEnabled();
data["dhtSameAsBT"] = pref.isDHTPortSameAsBT();
data["dht_port"] = pref.getDHTPort();
data["pex"] = pref.isPeXEnabled();
data["lsd"] = pref.isLSDEnabled();
data["encryption"] = pref.getEncryptionSetting();
data["anonymous_mode"] = pref.isAnonymousModeEnabled();
// Proxy
data["proxy_type"] = pref.getProxyType();
data["proxy_ip"] = pref.getProxyIp();
data["proxy_port"] = pref.getProxyPort();
data["proxy_peer_connections"] = pref.proxyPeerConnections();
data["proxy_auth_enabled"] = pref.isProxyAuthEnabled();
data["proxy_username"] = pref.getProxyUsername();
data["proxy_password"] = pref.getProxyPassword();
// IP Filter
data["ip_filter_enabled"] = pref.isFilteringEnabled();
data["ip_filter_path"] = fsutils::toNativePath(pref.getFilter());
// Web UI
data["web_ui_port"] = pref.getWebUiPort();
data["web_ui_username"] = pref.getWebUiUsername();
data["web_ui_password"] = pref.getWebUiPassword();
data["bypass_local_auth"] = !pref.isWebUiLocalAuthEnabled();
data["use_https"] = pref.isWebUiHttpsEnabled();
data["ssl_key"] = QString::fromLatin1(pref.getWebUiHttpsKey());
data["ssl_cert"] = QString::fromLatin1(pref.getWebUiHttpsCertificate());
// DynDns
data["dyndns_enabled"] = pref.isDynDNSEnabled();
data["dyndns_service"] = pref.getDynDNSService();
data["dyndns_username"] = pref.getDynDNSUsername();
data["dyndns_password"] = pref.getDynDNSPassword();
data["dyndns_domain"] = pref.getDynDomainName();
return json::toJson(data);
}