summaryrefslogtreecommitdiff
path: root/parse_file.cpp
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2016-07-27 17:27:44 +0930
committerdaniel-Jones <daniel@danieljon.es>2016-07-27 17:27:44 +0930
commit536bc6c7a1ea06769566f0558071ed92afaf57cd (patch)
tree0988bb1f3c59591c9f02cab32b0f1484df3b9e19 /parse_file.cpp
parentcdb03cae2c21c9a5ada496b92e705995334e9e9a (diff)
downloadcsgo_stats-536bc6c7a1ea06769566f0558071ed92afaf57cd.tar.gz
csgo_stats-536bc6c7a1ea06769566f0558071ed92afaf57cd.zip
Added the ability to select users from file - see source code for file example. you can dynamically refresh the stats and info to any person on the list/with a new ID. Added weapon icons from the games iconlibs.swf file; the images were ugly. added a few new stats etc
Diffstat (limited to 'parse_file.cpp')
-rw-r--r--parse_file.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/parse_file.cpp b/parse_file.cpp
index b939a7d..2193a04 100644
--- a/parse_file.cpp
+++ b/parse_file.cpp
@@ -47,3 +47,47 @@ QString parse_file::parse_csgo_data(QString option)
}
return "null";
}
+
+void parse_file::parse_users()
+{
+ /*
+ * This function populates our dropdown menu with users
+ *
+ * example users.dat file:
+ *
+ * daniel_j=76561198055087665
+ * ScruffyRules=76561198046533376
+ *
+ */
+ usernames.clear();
+ userids.clear();
+
+ QFile inputFile("users.dat");
+ if (inputFile.open(QIODevice::ReadOnly))
+ {
+ QTextStream in(&inputFile);
+ while (!in.atEnd())
+ {
+ QString line = in.readLine();
+ if (line.contains("="))
+ {
+ usernames.append(line.split("=")[0]);
+ userids.append(line.split("=")[1]);
+ }
+ }
+ inputFile.close();
+ } else
+ {
+ qDebug() << "No users loaded.";
+ }
+}
+
+QStringList parse_file::get_usernames()
+{
+ return usernames;
+}
+
+QStringList parse_file::get_ids()
+{
+ return userids;
+}