aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/aocharbutton.cpp4
-rw-r--r--src/aocharbutton.h4
-rw-r--r--src/aoevidencebutton.cpp4
-rw-r--r--src/aoevidencebutton.h5
-rw-r--r--src/demoserver.cpp6
-rw-r--r--src/evidence.cpp6
-rw-r--r--src/hardware_functions.cpp51
-rw-r--r--src/options.cpp10
-rw-r--r--src/text_file_functions.cpp18
9 files changed, 1 insertions, 107 deletions
diff --git a/src/aocharbutton.cpp b/src/aocharbutton.cpp
index fe87041f..71c29305 100644
--- a/src/aocharbutton.cpp
+++ b/src/aocharbutton.cpp
@@ -78,11 +78,7 @@ void AOCharButton::setCharacter(QString character)
}
}
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-void AOCharButton::enterEvent(QEvent *event)
-#else
void AOCharButton::enterEvent(QEnterEvent *event)
-#endif
{
int offset = Options::getInstance().themeScalingFactor();
ui_selector->move(x() - offset, y() - offset);
diff --git a/src/aocharbutton.h b/src/aocharbutton.h
index 64bea50a..6f2d9d9c 100644
--- a/src/aocharbutton.h
+++ b/src/aocharbutton.h
@@ -23,11 +23,7 @@ public:
void setTaken(bool enabled);
protected:
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- void enterEvent(QEvent *event) override;
-#else
void enterEvent(QEnterEvent *event) override;
-#endif
void leaveEvent(QEvent *event) override;
private:
diff --git a/src/aoevidencebutton.cpp b/src/aoevidencebutton.cpp
index 31163ca8..85809654 100644
--- a/src/aoevidencebutton.cpp
+++ b/src/aoevidencebutton.cpp
@@ -92,11 +92,7 @@ void AOEvidenceButton::mouseDoubleClickEvent(QMouseEvent *e)
Q_EMIT evidenceDoubleClicked(m_id);
}
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-void AOEvidenceButton::enterEvent(QEvent *e)
-#else
void AOEvidenceButton::enterEvent(QEnterEvent *e)
-#endif
{
ui_selector->show();
diff --git a/src/aoevidencebutton.h b/src/aoevidencebutton.h
index 9830384f..bc95f7ac 100644
--- a/src/aoevidencebutton.h
+++ b/src/aoevidencebutton.h
@@ -28,11 +28,8 @@ Q_SIGNALS:
void mouseoverUpdated(int id, bool state);
protected:
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- void enterEvent(QEvent *e) override;
-#else
void enterEvent(QEnterEvent *e) override;
-#endif
+
void leaveEvent(QEvent *e) override;
void mouseDoubleClickEvent(QMouseEvent *e) override;
diff --git a/src/demoserver.cpp b/src/demoserver.cpp
index f087dbd3..228824e4 100644
--- a/src/demoserver.cpp
+++ b/src/demoserver.cpp
@@ -306,9 +306,6 @@ void DemoServer::load_demo(QString filename)
p_path = filename;
// Process the demo file
QTextStream demo_stream(&demo_file);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- demo_stream.setCodec("UTF-8");
-#endif
QString line = demo_stream.readLine();
while (!line.isNull())
{
@@ -356,9 +353,6 @@ void DemoServer::load_demo(QString filename)
if (demo_file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
{
QTextStream out(&demo_file);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- out.setCodec("UTF-8");
-#endif
out << p_demo_data.dequeue();
for (const QString &line : std::as_const(p_demo_data))
{
diff --git a/src/evidence.cpp b/src/evidence.cpp
index aab7c8c7..dec67b85 100644
--- a/src/evidence.cpp
+++ b/src/evidence.cpp
@@ -860,9 +860,6 @@ void Courtroom::evidence_load(QString filename)
return;
}
QSettings inventory(filename, QSettings::IniFormat);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- inventory.setIniCodec("UTF-8");
-#endif
private_evidence_list.clear();
foreach (QString evi, inventory.childGroups())
{
@@ -889,9 +886,6 @@ void Courtroom::evidence_save(QString filename)
}
QSettings inventory(filename, QSettings::IniFormat);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- inventory.setIniCodec("UTF-8");
-#endif
inventory.clear();
for (int i = 0; i < private_evidence_list.size(); i++)
{
diff --git a/src/hardware_functions.cpp b/src/hardware_functions.cpp
index 67b5cafa..c4895873 100644
--- a/src/hardware_functions.cpp
+++ b/src/hardware_functions.cpp
@@ -52,57 +52,6 @@ QString get_hdid()
QAndroidJniObject androidId = QAndroidJniObject::callStaticObjectMethod("android/provider/Settings$Secure", "getString", "(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;", appctx.callObjectMethod("getContentResolver", "()Landroid/content/ContentResolver;").object<jobject>(), QAndroidJniObject::fromString("android_id").object<jstring>());
return androidId.toString();
}
-#elif QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
-#if (defined(LINUX) || defined(__linux__))
-#include <QSysInfo>
-
-QByteArray machineId;
-
-QString get_hdid()
-{
- machineId = QSysInfo::machineUniqueId();
-
- if (machineId.isEmpty())
- {
- return "gxsps32sa9fnwic92mfbs2";
- }
- return QString(machineId);
-}
-
-#elif defined __APPLE__
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <IOKit/IOKitLib.h>
-
-QString get_hdid()
-{
- CFStringRef serial;
- char buffer[64] = {0};
- QString hdid;
- io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
- if (platformExpert)
- {
- CFTypeRef serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault, 0);
- if (serialNumberAsCFString)
- {
- serial = (CFStringRef)serialNumberAsCFString;
- }
- if (CFStringGetCString(serial, buffer, 64, kCFStringEncodingUTF8))
- {
- hdid = buffer;
- }
-
- IOObjectRelease(platformExpert);
- }
- return hdid;
-}
-
-#else
-
-#error This operating system is unsupported for hardware functions.
-
-#endif
-
#else
#include <QSysInfo>
diff --git a/src/options.cpp b/src/options.cpp
index b0cbb39f..74bc3a3b 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -24,9 +24,6 @@ void Options::migrateCallwords()
}
QTextStream in(&l_file);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- in.setCodec("UTF-8");
-#endif
while (!in.atEnd())
{
@@ -43,14 +40,7 @@ Options::Options()
: config(get_base_path() + "config.ini", QSettings::IniFormat, nullptr)
, favorite(get_base_path() + "favorite_servers.ini", QSettings::IniFormat, nullptr)
{
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- config.setIniCodec("UTF-8");
-#endif
migrate();
-
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- favorite.setIniCodec("UTF-8");
-#endif
}
/*! Migrate old configuration keys/values to a relevant format. */
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index c6bd2dbe..50ed1f15 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -82,9 +82,6 @@ bool AOApplication::write_to_file(QString p_text, QString p_file, bool make_dir)
{
QTextStream out(&f_log);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- out.setCodec("UTF-8");
-#endif
out << p_text;
f_log.flush();
@@ -119,9 +116,6 @@ bool AOApplication::append_to_file(QString p_text, QString p_file, bool make_dir
{
QTextStream out(&f_log);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- out.setCodec("UTF-8");
-#endif
out << "\n" << p_text;
f_log.flush();
@@ -409,9 +403,6 @@ QString AOApplication::get_image_suffix(VPath path_to_check, bool static_image)
QString AOApplication::read_char_ini(QString p_char, QString p_search_line, QString target_tag)
{
QSettings settings(get_real_path(get_character_path(p_char, "char.ini")), QSettings::IniFormat);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- settings.setIniCodec("UTF-8");
-#endif
settings.beginGroup(target_tag);
QString value = settings.value(p_search_line).value<QString>();
settings.endGroup();
@@ -423,9 +414,6 @@ QStringList AOApplication::read_ini_tags(VPath p_path, QString target_tag)
{
QStringList r_values;
QSettings settings(get_real_path(p_path), QSettings::IniFormat);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- settings.setIniCodec("UTF-8");
-#endif
if (!target_tag.isEmpty())
{
settings.beginGroup(target_tag);
@@ -781,9 +769,6 @@ QStringList AOApplication::get_effects(QString p_char)
}
QSettings l_effects_ini(i_filepath, QSettings::IniFormat);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- l_effects_ini.setIniCodec("UTF-8");
-#endif
// port legacy effects
if (!l_effects_ini.contains("version/major") || l_effects_ini.value("version/major").toInt() < 2)
{
@@ -867,9 +852,6 @@ QString AOApplication::get_effect_property(QString fx_name, QString p_char, QStr
if (!path.isEmpty())
{
QSettings settings(path, QSettings::IniFormat);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- settings.setIniCodec("UTF-8");
-#endif
QStringList char_effects = settings.childGroups();
for (int i = 0; i < char_effects.size(); ++i)
{