Files
macports-ports/net/i2pchat/files/patch-qt4.diff

122 lines
4.3 KiB
Diff

--- src/backend/Main.cpp 2020-06-15 06:47:34.000000000 +0800
+++ src/backend/Main.cpp 2024-04-24 19:08:39.000000000 +0800
@@ -27,7 +27,7 @@
#include <QSettings>
#include <QTime>
#include <QDir>
-#include <QStandardPaths>
+#include <QDesktopServices>
#include <unistd.h>
#include <getopt.h>
@@ -38,8 +38,8 @@
QString debugLogDir;
void enableDebugLogging(QString configPath);
-//void myMessageHandler(QtMsgType type, const char *msg);
-void myMessageHandler(QtMsgType type,const QMessageLogContext &context,const QString &msg);
+void myMessageHandler(QtMsgType type, const char *msg);
+//void myMessageHandler(QtMsgType type,const QMessageLogContext &context,const QString &msg);
void help(void){
@@ -70,7 +70,7 @@
#ifdef ANDROID
- QStringList loc = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+ QStringList loc = QDesktopServices::standardLocations(QDesktopServices::GenericDataLocation);
if(loc.size()<=0){
QMessageBox::critical(
NULL,
@@ -114,9 +114,9 @@
#ifdef _WIN32
- configPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
+ configPath = QDesktopServices::storageLocation(QDesktopServices::AppDataLocation);
#else
- configPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+NameOfConfigDirectoryOnLinux;
+ configPath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation)+NameOfConfigDirectoryOnLinux;
#endif
@@ -167,7 +167,7 @@
//configPath=QApplication::applicationDirPath();
if(QFile::exists(configPath+"/UseHomeForConfigStore")==true){
- QStringList tmp=QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
+ QString tmp=QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
if(tmp.size()>=1){
configPath=tmp.at(0);
configPath+="/.I2PChat";
@@ -208,13 +208,13 @@
QSettings settings(configPath+"/application.ini",QSettings::IniFormat);
settings.beginGroup("General");
if(settings.value("DebugLogging","true").toBool()==true){
- qInstallMessageHandler(myMessageHandler);
+ qInstallMsgHandler(myMessageHandler);
}
settings.endGroup();
settings.sync();
}
-void myMessageHandler(QtMsgType type,const QMessageLogContext &context,const QString &msg)
+void myMessageHandler(QtMsgType type,const char *msg)
{
QString txt;
@@ -222,23 +222,23 @@
switch (type) {
case QtDebugMsg:{
- txt.append(QString(" Debug: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Debug: %1 (%2:%3, %4)\n").arg(msg));
break;
}
case QtWarningMsg:{
- txt.append(QString(" Warning: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Warning: %1 (%2:%3, %4)\n").arg(msg));
break;
}
case QtCriticalMsg:{
- txt.append(QString(" Critical: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Critical: %1 (%2:%3, %4)\n").arg(msg));
break;
}
case QtFatalMsg:{
- txt.append(QString(" Fatal: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Fatal: %1 (%2:%3, %4)\n").arg(msg));
break;
}
default:{
- txt.append(QString(" Message: %1 (%2:%3, %4)\n").arg(msg).arg(context.file).arg(context.line).arg(context.function));
+ txt.append(QString(" Message: %1 (%2:%3, %4)\n").arg(msg));
break;
}
}
--- src/backend/Core.cpp 2020-06-15 06:47:34.000000000 +0800
+++ src/backend/Core.cpp 2024-04-24 18:20:44.000000000 +0800
@@ -29,7 +29,7 @@
#include <QtGlobal>
#include <QMessageBox>
#include <QApplication>
-#include <QStandardPaths>
+#include <QDesktopServices>
CCore::CCore(QString configPath)
{
--- src/backend/TextEmotionChanger.cpp 2020-06-15 06:47:34.000000000 +0800
+++ src/backend/TextEmotionChanger.cpp 2024-04-24 18:32:19.000000000 +0800
@@ -171,7 +171,7 @@
{
if(tmp.isNull())
tmp = QPixmap(dirPath + "/" + fileName.at(0));
- QString text = emoticonString.text().toHtmlEscaped();
+ QString text = Qt::escape(emoticonString.text());
m_urls.insert(text,
QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"%4\" title=\"%4\"/>")
.arg(dirPath + "/" + fileName.at(0)).arg(tmp.size().width())