Changeset 135 for smplayer/trunk/src/preferences.cpp
- Timestamp:
- Oct 24, 2012, 8:25:23 PM (13 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 133
- Property svn:mergeinfo changed
-
smplayer/trunk/src/preferences.cpp
r128 r135 39 39 #endif 40 40 41 #define CURRENT_CONFIG_VERSION 1 42 41 43 using namespace Global; 42 44 … … 67 69 General 68 70 ******* */ 71 72 config_version = CURRENT_CONFIG_VERSION; 69 73 70 74 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) … … 194 198 #ifdef YOUTUBE_SUPPORT 195 199 yt_quality = RetrieveYoutubeUrl::MP4_720p; 200 yt_user_agent = QString::null; 196 201 #endif 197 202 … … 384 389 add_to_playlist_consecutive_files = false; 385 390 391 #if LOGO_ANIMATION 392 animated_logo = true; 393 #endif 394 386 395 387 396 /* ******** … … 401 410 latest_dir = QDir::homePath(); 402 411 last_dvd_directory=""; 403 412 save_dirs = true; 404 413 405 414 /* ************** … … 492 501 set->beginGroup( "general"); 493 502 503 set->setValue("config_version", config_version); 504 494 505 set->setValue("mplayer_bin", mplayer_bin); 495 506 set->setValue("driver/vo", vo); … … 605 616 set->setValue("cache_for_tv", cache_for_tv); 606 617 618 set->endGroup(); // performance 619 607 620 #ifdef YOUTUBE_SUPPORT 608 set->setValue("youtube_quality", yt_quality); 609 #endif 610 611 set->endGroup(); // performance 621 set->beginGroup("youtube"); 622 set->setValue("quality", yt_quality); 623 set->setValue("user_agent", yt_user_agent); 624 set->endGroup(); 625 #endif 612 626 613 627 … … 786 800 #endif 787 801 788 set->setValue("auto_add_to_playlist", auto_add_to_playlist); 789 set->setValue("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files); 802 set->setValue("auto_add_to_playlist", auto_add_to_playlist); 803 set->setValue("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files); 804 805 #if LOGO_ANIMATION 806 set->setValue("animated_logo", animated_logo); 807 #endif 790 808 791 809 set->endGroup(); // gui … … 808 826 809 827 set->beginGroup( "directories"); 810 set->setValue("latest_dir", latest_dir); 811 set->setValue("last_dvd_directory", last_dvd_directory); 828 if (save_dirs) { 829 set->setValue("latest_dir", latest_dir); 830 set->setValue("last_dvd_directory", last_dvd_directory); 831 } else { 832 set->setValue("latest_dir", ""); 833 set->setValue("last_dvd_directory", ""); 834 } 835 set->setValue("save_dirs", save_dirs); 812 836 set->endGroup(); // directories 813 837 … … 918 942 set->beginGroup( "general"); 919 943 944 config_version = set->value("config_version", 0).toInt(); 945 920 946 mplayer_bin = set->value("mplayer_bin", mplayer_bin).toString(); 921 947 vo = set->value("driver/vo", vo).toString(); … … 1033 1059 cache_for_tv = set->value("cache_for_tv", cache_for_tv).toInt(); 1034 1060 1061 set->endGroup(); // performance 1062 1035 1063 #ifdef YOUTUBE_SUPPORT 1036 yt_quality = set->value("youtube_quality", yt_quality).toInt(); 1037 #endif 1038 1039 set->endGroup(); // performance 1064 set->beginGroup("youtube"); 1065 yt_quality = set->value("quality", yt_quality).toInt(); 1066 yt_user_agent = set->value("user_agent", yt_user_agent).toString(); 1067 set->endGroup(); 1068 #endif 1040 1069 1041 1070 … … 1222 1251 add_to_playlist_consecutive_files = set->value("add_to_playlist_consecutive_files", add_to_playlist_consecutive_files).toBool(); 1223 1252 1253 #if LOGO_ANIMATION 1254 animated_logo = set->value("animated_logo", animated_logo).toBool(); 1255 #endif 1256 1224 1257 set->endGroup(); // gui 1225 1258 … … 1242 1275 1243 1276 set->beginGroup( "directories"); 1244 latest_dir = set->value("latest_dir", latest_dir).toString(); 1245 last_dvd_directory = set->value("last_dvd_directory", last_dvd_directory).toString(); 1277 save_dirs = set->value("save_dirs", save_dirs).toBool(); 1278 if (save_dirs) { 1279 latest_dir = set->value("latest_dir", latest_dir).toString(); 1280 last_dvd_directory = set->value("last_dvd_directory", last_dvd_directory).toString(); 1281 } 1246 1282 set->endGroup(); // directories 1247 1283 … … 1339 1375 1340 1376 filters->load(set); 1377 1378 // Fix some values if config is old 1379 if (config_version < CURRENT_CONFIG_VERSION) { 1380 qDebug("Preferences::load: config version is old, updating it"); 1381 config_version = CURRENT_CONFIG_VERSION; 1382 /* 1383 iconset = "Nuvola"; 1384 yt_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"; 1385 */ 1386 } 1341 1387 } 1342 1388
Note:
See TracChangeset
for help on using the changeset viewer.