summaryrefslogtreecommitdiff
path: root/source/kde/patch/ktorrent/ktorrent.use.package.geoip.database.diff
diff options
context:
space:
mode:
Diffstat (limited to 'source/kde/patch/ktorrent/ktorrent.use.package.geoip.database.diff')
-rw-r--r--source/kde/patch/ktorrent/ktorrent.use.package.geoip.database.diff37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/kde/patch/ktorrent/ktorrent.use.package.geoip.database.diff b/source/kde/patch/ktorrent/ktorrent.use.package.geoip.database.diff
new file mode 100644
index 00000000..0a9fd804
--- /dev/null
+++ b/source/kde/patch/ktorrent/ktorrent.use.package.geoip.database.diff
@@ -0,0 +1,37 @@
+--- ./plugins/infowidget/geoipmanager.cpp.orig 2013-01-14 11:12:24.000000000 -0600
++++ ./plugins/infowidget/geoipmanager.cpp 2019-03-17 15:14:38.020018110 -0500
+@@ -39,7 +39,7 @@
+ #ifdef USE_SYSTEM_GEOIP
+ geo_ip = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD);
+ #else
+- geoip_data_file = KStandardDirs::locate("data", "ktorrent/geoip.dat");
++ geoip_data_file = "/usr/share/apps/ktorrent/GeoIP/geoip.dat";
+ if (geoip_data_file.isNull())
+ geoip_data_file = KStandardDirs::locate("data", "ktorrent/GeoIP.dat");
+
+@@ -54,12 +54,6 @@
+ {
+ QFileInfo fi(geoip_data_file);
+ QDateTime now = QDateTime::currentDateTime();
+- if (fi.lastModified().daysTo(now) >= 30)
+- {
+- // if the last time the geoip file was modified, was more then
+- // 30 days ago, redownload it
+- downloadDataBase();
+- }
+ }
+ }
+ #endif
+@@ -104,12 +98,6 @@
+
+ void GeoIPManager::downloadDataBase()
+ {
+-#ifndef USE_SYSTEM_GEOIP
+- Out(SYS_INW|LOG_NOTICE) << "Downloading GeoIP database: " << geoip_url.prettyUrl() << endl;
+- download_destination = kt::DataDir() + geoip_url.fileName();
+- KIO::CopyJob* job = KIO::copy(geoip_url,download_destination,KIO::Overwrite|KIO::HideProgressInfo);
+- connect(job,SIGNAL(result(KJob*)),this,SLOT(databaseDownloadFinished(KJob*)));
+-#endif
+ }
+
+ void GeoIPManager::databaseDownloadFinished(KJob* job)