Skip to content

Instantly share code, notes, and snippets.

@sledgehammer999
Created July 24, 2015 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sledgehammer999/48a48babfdf16e3f64f9 to your computer and use it in GitHub Desktop.
Save sledgehammer999/48a48babfdf16e3f64f9 to your computer and use it in GitHub Desktop.
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index 32a172f..508efd1 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -46,6 +46,7 @@
#include <QScrollBar>
#include <QMimeData>
#include <QCryptographicHash>
+#include <QHostAddress>
#include "mainwindow.h"
#include "transferlistwidget.h"
@@ -75,6 +76,8 @@
#include "guiiconprovider.h"
#include "core/logger.h"
#include "autoexpandabledialog.h"
+#include "core/net/geoipmanager.h"
+
#ifdef Q_OS_MAC
void qt_mac_set_dock_menu(QMenu *menu);
#endif
@@ -1329,14 +1332,39 @@ void MainWindow::createTrayIcon()
// Display Program Options
void MainWindow::on_actionOptions_triggered()
{
- if (options) {
+ /*if (options) {
// Get focus
options->setFocus();
}
else {
options = new options_imp(this);
connect(options, SIGNAL(status_changed()), this, SLOT(optionsSaved()));
+ }*/
+
+ qint64 startTime;
+ qint64 endTime;
+ QString countryCode;
+ QFile file("random_IPs.txt");
+ file.open(QIODevice::ReadOnly|QIODevice::Text);
+ QTextStream str(&file);
+
+ QList<QHostAddress> ips;
+ while (!str.atEnd()) {
+ QHostAddress addr(str.readLine());
+ ips.append(addr);
}
+
+ file.close();
+
+ startTime = QDateTime::currentMSecsSinceEpoch();
+
+ for (int i = 0; i < ips.size(); ++i)
+ countryCode = Net::GeoIPManager::instance()->lookup(ips[i]);
+
+ endTime = QDateTime::currentMSecsSinceEpoch();
+
+ qCritical() << (endTime - startTime);
+
}
void MainWindow::on_actionTop_tool_bar_triggered()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment