diff --git a/src/appmanager.cpp b/src/appmanager.cpp index 5cea1fdc38..f072992cac 100644 --- a/src/appmanager.cpp +++ b/src/appmanager.cpp @@ -6,6 +6,7 @@ #include "appmanager.h" #include "src/ipc.h" +#include "src/model/debug/debuglogmodel.h" #include "src/net/toxuri.h" #include "src/net/updatecheck.h" #include "src/nexus.h" @@ -33,8 +34,8 @@ namespace { // inability to register a void* to get back to a class #ifdef LOG_TO_FILE QAtomicPointer logFileFile = nullptr; -QList* logBuffer = new QList(); // Store log messages until log file opened -QMutex* logBufferMutex = new QMutex(); +auto logBuffer = std::make_unique>(); // Store log messages until log file opened +auto logBufferMutex = std::make_unique(); #endif constexpr std::string_view sourceRootPath() @@ -102,73 +103,55 @@ void logMessageHandler(QtMsgType type, const QMessageLogContext& ctxt, const QSt return; } - const QString file = canonicalLogFilePath(ctxt.file); - const QString category = - (ctxt.category != nullptr) ? QString::fromUtf8(ctxt.category) : QStringLiteral("default"); - if ((type == QtDebugMsg && category == QStringLiteral("tox.core") - && (file == QStringLiteral("rtp.c") || file == QStringLiteral("video.c"))) - || (file == QStringLiteral("bwcontroller.c") && msg.contains("update"))) { + // Time should be in UTC to save user privacy on log sharing. + DebugLogModel::LogEntry entry{ + -1, + QDateTime::currentDateTime().toUTC(), + ctxt.category != nullptr ? QString::fromUtf8(ctxt.category) : QStringLiteral("default"), + canonicalLogFilePath(ctxt.file), + ctxt.line, + type, + }; + + if ((entry.type == QtDebugMsg && entry.category == QStringLiteral("tox.core") + && (entry.file == QStringLiteral("rtp.c") || entry.file == QStringLiteral("video.c"))) + || (entry.file == QStringLiteral("bwcontroller.c") && msg.contains("update"))) { // Don't log verbose toxav messages. return; } - // Time should be in UTC to save user privacy on log sharing - const QTime time = QDateTime::currentDateTime().toUTC().time(); - QString logPrefix = - QStringLiteral("[%1 UTC] (%2) %3:%4 : ") - .arg(time.toString("HH:mm:ss.zzz"), category, file, QString::number(ctxt.line)); - switch (type) { - case QtDebugMsg: - logPrefix += "Debug"; - break; - case QtInfoMsg: - logPrefix += "Info"; - break; - case QtWarningMsg: - logPrefix += "Warning"; - break; - case QtCriticalMsg: - logPrefix += "Critical"; - break; - case QtFatalMsg: - logPrefix += "Fatal"; - break; - default: - break; - } - QString logMsg; for (const auto& line : msg.split('\n')) { - logMsg += logPrefix + ": " + canonicalLogMessage(line) + "\n"; + entry.message = canonicalLogMessage(line); + logMsg += DebugLogModel::render(entry); + logMsg += '\n'; } - const QByteArray LogMsgBytes = logMsg.toUtf8(); - fwrite(LogMsgBytes.constData(), 1, LogMsgBytes.size(), stderr); + const QByteArray logMsgBytes = logMsg.toUtf8(); + fwrite(logMsgBytes.constData(), 1, logMsgBytes.size(), stderr); #ifdef LOG_TO_FILE - FILE* logFilePtr = logFileFile.loadRelaxed(); // atomically load the file pointer + FILE* const logFilePtr = logFileFile.loadRelaxed(); // atomically load the file pointer if (logFilePtr == nullptr) { - logBufferMutex->lock(); - if (logBuffer != nullptr) - logBuffer->append(LogMsgBytes); - - logBufferMutex->unlock(); - } else { - logBufferMutex->lock(); + const QMutexLocker locker(logBufferMutex.get()); if (logBuffer != nullptr) { - // empty logBuffer to file - for (const QByteArray& bufferedMsg : *logBuffer) { - fwrite(bufferedMsg.constData(), 1, bufferedMsg.size(), logFilePtr); - } + logBuffer->append(logMsgBytes); + } + return; + } - delete logBuffer; // no longer needed - logBuffer = nullptr; + const QMutexLocker locker(logBufferMutex.get()); + if (logBuffer != nullptr) { + // empty logBuffer to file + for (const QByteArray& bufferedMsg : *logBuffer) { + fwrite(bufferedMsg.constData(), 1, bufferedMsg.size(), logFilePtr); } - logBufferMutex->unlock(); - fwrite(LogMsgBytes.constData(), 1, LogMsgBytes.size(), logFilePtr); - fflush(logFilePtr); + logBuffer = nullptr; // no longer needed } + + fwrite(logMsgBytes.constData(), 1, logMsgBytes.size(), logFilePtr); + fflush(logFilePtr); #endif } diff --git a/src/model/debug/debuglogmodel.cpp b/src/model/debug/debuglogmodel.cpp index fd6bae9ac9..7a59439ad3 100644 --- a/src/model/debug/debuglogmodel.cpp +++ b/src/model/debug/debuglogmodel.cpp @@ -4,10 +4,15 @@ #include "debuglogmodel.h" +#include "util/ranges.h" + #include #include namespace { +const QString timeFormat = QStringLiteral("HH:mm:ss.zzz"); +const QString dateTimeFormat = QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz"); + QtMsgType parseMsgType(const QString& type) { if (type == "Debug") { @@ -47,7 +52,27 @@ QString renderMsgType(QtMsgType type) return QStringLiteral("Unknown"); } -QList parse(const QStringList& logs) +bool filterAccepts(DebugLogModel::Filter filter, QtMsgType type) +{ + switch (filter) { + case DebugLogModel::All: + return true; + case DebugLogModel::Debug: + return type == QtDebugMsg; + case DebugLogModel::Info: + return type == QtInfoMsg; + case DebugLogModel::Warning: + return type == QtWarningMsg; + case DebugLogModel::Critical: + return type == QtCriticalMsg; + case DebugLogModel::Fatal: + return type == QtFatalMsg; + } + return false; +} +} // namespace + +QList DebugLogModel::parse(const QStringList& logs) { // Regex extraction of log entry // [12:35:16.634 UTC] (default) src/core/core.cpp:370 : Debug: Connected to a TCP relay @@ -56,17 +81,29 @@ QList parse(const QStringList& logs) static const QRegularExpression re( R"(\[([0-9:.]*) UTC\](?: \(([^)]*)\))? (.*?):(\d+) : ([^:]+): (.*))"); + // Assume the last log entry is today. + const QDateTime now = QDateTime::currentDateTime().toUTC(); + QDate lastDate = now.date(); + QTime lastTime = now.time(); + QList result; - for (const QString& log : logs) { + for (const QString& log : qtox::views::reverse(logs)) { const auto match = re.match(log); if (!match.hasMatch()) { qWarning() << "Failed to parse log entry:" << log; continue; } + // Reconstruct the likely date of the log entry. + const QTime entryTime = QTime::fromString(match.captured(1), timeFormat); + if (entryTime > lastTime) { + lastDate = lastDate.addDays(-1); + } + lastTime = entryTime; + DebugLogModel::LogEntry entry; entry.index = result.size(); - entry.time = match.captured(1); + entry.time = QDateTime{lastDate, entryTime}; entry.category = match.captured(2); if (entry.category.isEmpty()) { entry.category = QStringLiteral("default"); @@ -77,36 +114,19 @@ QList parse(const QStringList& logs) entry.message = match.captured(6); result.append(entry); } + + std::reverse(result.begin(), result.end()); return result; } -QString render(const DebugLogModel::LogEntry& entry) +QString DebugLogModel::render(const DebugLogModel::LogEntry& entry, bool includeDate) { return QStringLiteral("[%1 UTC] (%2) %3:%4 : %5: %6") - .arg(entry.time, entry.category, entry.file, QString::number(entry.line), - renderMsgType(entry.type), entry.message); + .arg(includeDate ? entry.time.toString(dateTimeFormat) : entry.time.toString(timeFormat), + entry.category, entry.file, QString::number(entry.line), renderMsgType(entry.type), + entry.message); } -bool filterAccepts(DebugLogModel::Filter filter, QtMsgType type) -{ - switch (filter) { - case DebugLogModel::All: - return true; - case DebugLogModel::Debug: - return type == QtDebugMsg; - case DebugLogModel::Info: - return type == QtInfoMsg; - case DebugLogModel::Warning: - return type == QtWarningMsg; - case DebugLogModel::Critical: - return type == QtCriticalMsg; - case DebugLogModel::Fatal: - return type == QtFatalMsg; - } - return false; -} -} // namespace - DebugLogModel::DebugLogModel(QObject* parent) : QAbstractListModel(parent) { diff --git a/src/model/debug/debuglogmodel.h b/src/model/debug/debuglogmodel.h index b29282a9cb..454cf54804 100644 --- a/src/model/debug/debuglogmodel.h +++ b/src/model/debug/debuglogmodel.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include class DebugLogModel : public QAbstractListModel @@ -29,7 +30,7 @@ class DebugLogModel : public QAbstractListModel /// Index in the original log list. int index; - QString time; + QDateTime time; QString category; QString file; int line; @@ -52,6 +53,21 @@ class DebugLogModel : public QAbstractListModel */ int originalIndex(const QModelIndex& index) const; + /** + * @brief Parse a list of log lines into LogEntry objects. + */ + static QList parse(const QStringList& logs); + + /** + * @brief Render a LogEntry object into a string. + */ + static QString render(const LogEntry& entry, bool includeDate = false); + + static QString renderWithDate(const LogEntry& entry) + { + return render(entry, true); + } + private: void recomputeFilter(); diff --git a/src/widget/form/debug/debuglog.cpp b/src/widget/form/debug/debuglog.cpp index 42a9b73a8b..24741ad4e2 100644 --- a/src/widget/form/debug/debuglog.cpp +++ b/src/widget/form/debug/debuglog.cpp @@ -94,7 +94,6 @@ DebugLogForm::~DebugLogForm() void DebugLogForm::showEvent(QShowEvent* event) { - qDebug() << "Loading logs for debug log view"; debugLogModel_->reload(loadLogs(paths_)); GenericForm::showEvent(event); diff --git a/src/widget/form/settings/advancedform.cpp b/src/widget/form/settings/advancedform.cpp index 554c69c0ed..ce55c63599 100644 --- a/src/widget/form/settings/advancedform.cpp +++ b/src/widget/form/settings/advancedform.cpp @@ -7,11 +7,13 @@ #include "ui_advancedsettings.h" +#include "src/model/debug/debuglogmodel.h" #include "src/persistence/profile.h" #include "src/persistence/settings.h" #include "src/widget/tool/imessageboxmanager.h" #include "src/widget/tool/recursivesignalblocker.h" #include "src/widget/translator.h" +#include "util/fileutil.h" #include #include @@ -20,6 +22,8 @@ #include #include +#include + /** * @class AdvancedForm * @@ -120,29 +124,36 @@ void AdvancedForm::on_btnCopyDebug_clicked() const QString logFileDir = settings.getPaths().getAppCacheDirPath(); const QString logfile = logFileDir + "qtox.log"; - QFile file(logfile); - if (!file.exists()) { - qDebug() << "No debug file found"; + QClipboard* clipboard = QApplication::clipboard(); + if (clipboard == nullptr) { + qDebug() << "Unable to access clipboard"; return; } - QClipboard* clipboard = QApplication::clipboard(); - if (clipboard != nullptr) { - QString debugtext; - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QTextStream in(&file); - debugtext = in.readAll(); - file.close(); - } else { - qDebug() << "Unable to open file for copying to clipboard"; - return; - } - - clipboard->setText(debugtext, QClipboard::Clipboard); - qDebug() << "Debug log copied to clipboard"; - } else { - qDebug() << "Unable to access clipboard"; + // Maximum number of lines to copy to clipboard. + const int maxDebugLogLines = bodyUI->maxLogLines->value(); + const QStringList lines = FileUtil::tail(logfile, maxDebugLogLines); + + if (lines.isEmpty()) { + return; + } + + // Parse the log entries and remove entries that are too old. + QList logEntries = DebugLogModel::parse(lines); + std::reverse(logEntries.begin(), logEntries.end()); + const QDateTime now = QDateTime::currentDateTimeUtc(); + const int maxDebugLogAge = + bodyUI->maxLogAge->time().hour() * 3600 + bodyUI->maxLogAge->time().minute() * 60; + while (!logEntries.isEmpty() && logEntries.last().time.secsTo(now) > maxDebugLogAge) { + logEntries.removeLast(); } + + QStringList debugText; + std::transform(logEntries.rbegin(), logEntries.rend(), std::back_inserter(debugText), + DebugLogModel::renderWithDate); + + clipboard->setText(debugText.join('\n'), QClipboard::Clipboard); + qDebug() << "Copied" << debugText.size() << "debug log entries to clipboard"; } void AdvancedForm::on_resetButton_clicked() diff --git a/src/widget/form/settings/advancedsettings.ui b/src/widget/form/settings/advancedsettings.ui index a4ec756c57..30ddbf5fab 100644 --- a/src/widget/form/settings/advancedsettings.ui +++ b/src/widget/form/settings/advancedsettings.ui @@ -24,8 +24,8 @@ 0 0 - 485 - 545 + 479 + 539 @@ -35,16 +35,16 @@ {IMPORTANT NOTE HERE} - Qt::RichText + Qt::TextFormat::RichText - Qt::AlignCenter + Qt::AlignmentFlag::AlignCenter true - Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse @@ -93,6 +93,63 @@ + + + + + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + + + lines + + + 10 + + + 5000 + + + 1000 + + + + + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + + + Max age: + + + + + + + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + @@ -111,7 +168,7 @@ Connection settings - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop @@ -231,7 +288,7 @@ - Qt::Vertical + Qt::Orientation::Vertical diff --git a/tools/translate.py b/tools/translate.py index 6fa6636549..324e24bafa 100755 --- a/tools/translate.py +++ b/tools/translate.py @@ -181,6 +181,8 @@ def _fix_translation(lang: Language, source: str, text: str) -> str: f"'{source}': '{text}'") if "%" in source: text = text.replace("%%", "%") + if source.startswith(" ") and not text.startswith(" "): + text = " " + text return text diff --git a/translations/ar.ts b/translations/ar.ts index d06d3cfb00..c6120444c5 100644 --- a/translations/ar.ts +++ b/translations/ar.ts @@ -642,6 +642,26 @@ which may lead to problems with video calls. Automated translation. تمكين أدوات التصحيح (للمطورين فقط) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + الحد الأقصى لعدد الأسطر التي سيتم نسخها إلى الحافظة عند الضغط على "نسخ سجل التصحيح". + + + lines + Automated translation. + خطوط + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + الحد الأقصى للسن (في الساعات/الدقائق) من خطوط السجل للنسخ في الحافظة عند الضغط على "Copy Debug Log". + + + Max age: + Automated translation. + أقصى سن: + AppManager @@ -1350,7 +1370,7 @@ so you can save the file on Windows. MB Automated translation. - ميغابايت + ميغابايت After pressing minimize (_) qTox will minimize to tray, diff --git a/translations/be.ts b/translations/be.ts index 4bf383b3e3..9ceced8ead 100644 --- a/translations/be.ts +++ b/translations/be.ts @@ -613,6 +613,26 @@ which may lead to problems with video calls. Automated translation. Уключыць інструменты адладкі (толькі для распрацоўшчыкаў) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максімальная колькасць радкоў, каб скапіяваць у буфер абмену пры націску "Скапіруйце часопіс адладкі". + + + lines + Automated translation. + ліній + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максімальны ўзрост (у гадзінах/хвілінах) радкоў часопісаў, каб скапіяваць у буфер абмену пры націску "Скапіруйце часопіс адладкі". + + + Max age: + Automated translation. + Максімальны ўзрост: + AppManager diff --git a/translations/ber.ts b/translations/ber.ts index 208f7e2768..b4a2312f47 100644 --- a/translations/ber.ts +++ b/translations/ber.ts @@ -700,6 +700,26 @@ which may lead to problems with video calls. Automated translation. ⴰⵙⴻⴽⵛⴻⵎ ⵏ ⵡⴰⵢⴰ ⵢⴻⵜⵜⴰⴵⴵⴰ, ⴰⵎⴻⴷⵢⴰ, Tox ⵖⴻⴼ Tor. ⵢⴻⵔⵏⴰⴷ ⵍⵃⴻⴱⵙ ⵉ ⵓⵥⴻⴹⴹⴰ ⵏ Tox ⴷ ⴰⵛⵓ ⴽⴰⵏ, ⵉⵀⵉ ⵙⴼⴻⴹ ⴽⴰⵏ ⵎⵉ ⴰⵔⴰ ⵉⵍⴰⵇ. + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + ⴰⵎⴹⴰⵏ ⴰⵅⴰⵜⴰⵔ ⵏ ⵉⵣⵔⵉⵔⵉⴳⵏ ⵃⵎⴰ ⴰⴷ ⵏⵙⴽⵛⵎ ⴳ ⵓⴽⵍⵓ ⵍⵍⵉⴳ ⴷⴰ ⵉⵜⵜⵓⵙⵎⵔⴰⵙ "Copy Debug Log". + + + lines + Automated translation. + ⵉⵖⴻⵣⵔⴰⵏ + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + ⵍⴻⵄⵎⴻⵔ ⴰⵎⴻⵇⵇⵔⴰⵏ (ⵙ ⵜⵙⴰⵄⵜⵉⵏ/ⵜⴻⴷⵇⵉⵇⵉⵏ) ⵏ ⵢⵉⴼⴻⵔⴷⵉⵙⴻⵏ ⵏ ⵓⵖⵎⵉⵙ ⴰⵔⴰ ⵜⴻⵙⵏⵓⵍⴼⵓⴹ ⴷⴻⴳ ⵜⴼⴻⵍⵡⵉⵜ ⵏ ⵜⴼⴻⵍⵡⵉⵜ ⵎⵉ ⴰⵔⴰ ⵜⵜⴻⵟⵟⴼⴻⴹ "Snulfuḍ ⴰⵖⵎⵉⵙ ⵏ ⵓⵙⵎⴻⵍ". + + + Max age: + Automated translation. + ⵍⴻⵄⵎⴻⵔ ⴰⵎⴻⵇⵇⵔⴰⵏ: + AppManager @@ -1495,7 +1515,7 @@ so you can save the file on Windows. MB Automated translation. - ⵎⴱ + ⵎⴱ After pressing minimize (_) qTox will minimize to tray, @@ -3404,7 +3424,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/bg.ts b/translations/bg.ts index b444bdcea0..56a1c91f75 100644 --- a/translations/bg.ts +++ b/translations/bg.ts @@ -592,6 +592,26 @@ which may lead to problems with video calls. Automated translation. Активиране на инструментите за отстраняване на грешки (само за разработчици) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимален брой редове за копиране в клипборда при натискане на „Копиране на журнала за отстраняване на грешки“. + + + lines + Automated translation. + линии + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимална възраст (в часове/минути) на редовете в регистрационния файл за копиране в клипборда при натискане на „Копиране на журнала за отстраняване на грешки“. + + + Max age: + Automated translation. + Максимална възраст: + AppManager diff --git a/translations/bn.ts b/translations/bn.ts index 84ee7a5aa9..e7b7f4af54 100644 --- a/translations/bn.ts +++ b/translations/bn.ts @@ -715,6 +715,26 @@ which may lead to problems with video calls. Automated translation. ডিবাগ টুল সক্ষম করুন (শুধুমাত্র বিকাশকারীরা) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "অনুলিপি ডিবাগ লগ" টিপানোর সময় ক্লিপবোর্ডে অনুলিপি করার জন্য সর্বাধিক সংখ্যক লাইন। + + + lines + Automated translation. + লাইন + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "অনুলিপি ডিবাগ লগ" টিপানোর সময় ক্লিপবোর্ডে অনুলিপি করতে সর্বাধিক বয়স (ঘন্টা/মিনিটে) লগ লাইনের অনুলিপি করতে। + + + Max age: + Automated translation. + সর্বাধিক বয়স: + AppManager @@ -1523,7 +1543,7 @@ so you can save the file on Windows. MB Automated translation. - এমবি + এমবি After pressing minimize (_) qTox will minimize to tray, @@ -3460,7 +3480,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/cs.ts b/translations/cs.ts index 1d321bbbac..66cd0a4408 100644 --- a/translations/cs.ts +++ b/translations/cs.ts @@ -592,6 +592,26 @@ může dojít během video hovoru k výpadkům či jiným problémům.Automated translation. Povolit nástroje ladění (pouze pro vývojáře) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximální počet řádků, které se mají kopírovat do schránky při stisknutí „Kopírovat protokol ladění“. + + + lines + Automated translation. + řádky + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximální věk (v hodinách/minutách) linek protokolu pro kopírování do schránky při stisknutí „Kopírovat protokol debug“. + + + Max age: + Automated translation. + Max Age: + AppManager diff --git a/translations/da.ts b/translations/da.ts index 22f045f95f..9ca3c84e1e 100644 --- a/translations/da.ts +++ b/translations/da.ts @@ -649,6 +649,26 @@ hvilket kan føre til problemer med videoopkald. Automated translation. Aktiver fejlretningsværktøjer (kun udviklere) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimalt antal linjer, der skal kopieres til udklipsholderen, når du trykker på "Kopier fejlretningslog". + + + lines + Automated translation. + linjer + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimal alder (i timer/minutter) af loglinjer, der skal kopieres til udklipsholderen, når du trykker på "Kopi -debug -log". + + + Max age: + Automated translation. + Max alder: + AppManager @@ -1406,7 +1426,7 @@ så du kan gemme filen på Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3264,7 +3284,7 @@ Skjul formateringstegn: px Automated translation. - px + px Theme diff --git a/translations/de.ts b/translations/de.ts index 5764e94fab..0a14bae516 100644 --- a/translations/de.ts +++ b/translations/de.ts @@ -589,6 +589,26 @@ dadurch kann es zu Problemen bei Videoanrufen kommen. Enable Debug Tools (developers only) Debug-Tools einschalten (nur Entwickler) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximale Anzahl der Zeilen, die in die Zwischenablage kopiert werden sollen, wenn Sie auf „Debug-Protokoll kopieren“ klicken. + + + lines + Automated translation. + Zeilen + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximales Alter (in Stunden/Minuten) der Protokollzeilen, die in die Zwischenablage kopiert werden sollen, wenn Sie auf „Debug-Protokoll kopieren“ klicken. + + + Max age: + Automated translation. + Maximales Alter: + AppManager diff --git a/translations/el.ts b/translations/el.ts index 18186eb045..1bc79ec8ff 100644 --- a/translations/el.ts +++ b/translations/el.ts @@ -619,6 +619,26 @@ which may lead to problems with video calls. Automated translation. Ενεργοποίηση εργαλείων εντοπισμού σφαλμάτων (μόνο για προγραμματιστές) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Μέγιστος αριθμός γραμμών για αντιγραφή στο πρόχειρο όταν πατάτε "Αντιγραφή αρχείου καταγραφής εντοπισμού σφαλμάτων". + + + lines + Automated translation. + γραμμές + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Μέγιστη ηλικία (σε ώρες/λεπτά) γραμμών καταγραφής για αντιγραφή στο πρόχειρο όταν πατάτε "Αντιγραφή αρχείου καταγραφής εντοπισμού σφαλμάτων". + + + Max age: + Automated translation. + Μέγιστη ηλικία: + AppManager @@ -1309,7 +1329,7 @@ so you can save the file on Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, diff --git a/translations/eo.ts b/translations/eo.ts index 652662b264..1a1191ea1e 100644 --- a/translations/eo.ts +++ b/translations/eo.ts @@ -670,6 +670,26 @@ kio povas konduki al problemoj kun videovokoj. Automated translation. Ebligu Sencimigajn Ilojn (nur programistoj) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimuma nombro da linioj por kopii en la tondujo premante "Kopii Sencimigan Protokolon". + + + lines + Automated translation. + linioj + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimuma aĝo (en horoj/minutoj) de logaj linioj por kopii en la klipo kiam oni premas "Kopiu Debug Log". + + + Max age: + Automated translation. + Max Age: + AppManager @@ -1425,7 +1445,7 @@ do vi povas konservi la dosieron en Vindozo. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, diff --git a/translations/es.ts b/translations/es.ts index 2b5aea686f..7a259a540e 100644 --- a/translations/es.ts +++ b/translations/es.ts @@ -590,6 +590,26 @@ lo que puede provocar problemas en las videollamadas. Enable Debug Tools (developers only) Activar herramientas de depuración (solo para desarrolladores) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Número máximo de líneas para copiar en el portapapeles al presionar "Copiar registro de depuración". + + + lines + Automated translation. + pauta + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Antigüedad máxima (en horas/minutos) de las líneas de registro para copiar en el portapapeles al presionar "Copiar registro de depuración". + + + Max age: + Automated translation. + Edad máxima: + AppManager diff --git a/translations/et.ts b/translations/et.ts index 33b3d6bf4c..e1d594f693 100644 --- a/translations/et.ts +++ b/translations/et.ts @@ -591,6 +591,26 @@ mis võib põhjustada probleeme videokõnedega. Automated translation. Silumistööriistade lubamine (ainult arendajatele) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "Kopeerige silumislogi" vajutamisel lõikelauale maksimaalne arv ridasid. + + + lines + Automated translation. + read + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Lõikepuhvrisse kopeeritavate logiridade maksimaalne vanus (tundides/minutites), kui vajutate nuppu "Kopeeri silumislogi". + + + Max age: + Automated translation. + Max vanus: + AppManager diff --git a/translations/fa.ts b/translations/fa.ts index 2fbb7b8c54..1eecdb7e9b 100644 --- a/translations/fa.ts +++ b/translations/fa.ts @@ -611,6 +611,26 @@ which may lead to problems with video calls. Automated translation. فعال کردن ابزار Debug Tools (فقط توسعه دهندگان) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + حداکثر تعداد خطوط برای کپی در کلیپ بورد هنگام فشار دادن "Copy Debug Log". + + + lines + Automated translation. + خط + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + حداکثر سن (به ساعت/دقیقه) خطوط گزارش برای کپی در کلیپ بورد هنگام فشار دادن "Copy Debug Log". + + + Max age: + Automated translation. + حداکثر سن: + AppManager diff --git a/translations/fi.ts b/translations/fi.ts index dbd2c0c53a..1cf0718502 100644 --- a/translations/fi.ts +++ b/translations/fi.ts @@ -591,6 +591,26 @@ mikä voi johtaa ongelmiin videopuheluissa. Automated translation. Ota virheenkorjaustyökalut käyttöön (vain kehittäjät) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Leikepöydälle kopioitavien rivien enimmäismäärä, kun painetaan "Kopioi virheenkorjausloki". + + + lines + Automated translation. + rivit + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Suurin ikä (tunteina/minuutteina) lokiviivoja kopioidaksesi leikepöydälle painamalla "Kopioi Debug Log". + + + Max age: + Automated translation. + Max Age: + AppManager diff --git a/translations/fr.ts b/translations/fr.ts index 6849ea93b2..3291ee2d76 100644 --- a/translations/fr.ts +++ b/translations/fr.ts @@ -591,6 +591,26 @@ ce qui peut entraîner des problèmes lors des appels vidéo. Automated translation. Activer les outils de débogage (développeurs uniquement) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Nombre maximum de lignes à copier dans le presse-papiers en appuyant sur "Copier le journal de débogage". + + + lines + Automated translation. + lignes + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Âge maximum (en heures/minutes) des lignes de journal à copier dans le presse-papiers en appuyant sur "Copier le journal de débogage". + + + Max age: + Automated translation. + Âge maximum: + AppManager diff --git a/translations/gl.ts b/translations/gl.ts index c458d51c26..60e922560e 100644 --- a/translations/gl.ts +++ b/translations/gl.ts @@ -612,6 +612,26 @@ o que pode provocar problemas coas videochamadas. Automated translation. Activar ferramentas de depuración (só para programadores) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Número máximo de liñas para copiar no portapapeis ao premer "Copiar rexistro de depuración". + + + lines + Automated translation. + liñas + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + A idade máxima (en horas/minutos) das liñas de rexistro para copiar no portapapeis ao premer "Copiar rexistro de depuración". + + + Max age: + Automated translation. + Idade máxima: + AppManager diff --git a/translations/he.ts b/translations/he.ts index 56d1c285af..f3837ce1c2 100644 --- a/translations/he.ts +++ b/translations/he.ts @@ -699,6 +699,26 @@ which may lead to problems with video calls. Automated translation. הפעל כלי ניפוי באגים (למפתחים בלבד) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + המספר המרבי של השורות להעתקה בלוח הלוח כאשר לוחצים על "העתק יומן באגים". + + + lines + Automated translation. + קווים + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + הגיל המרבי (בשעות/דקות) של שורות יומן להעתקה ללוח בעת לחיצה על "העתק יומן ניפוי באגים". + + + Max age: + Automated translation. + גיל מקסימום: + AppManager @@ -1507,7 +1527,7 @@ so you can save the file on Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3442,7 +3462,7 @@ Hide formatting characters: px Automated translation. - פיקסלים + פיקסלים Theme diff --git a/translations/hr.ts b/translations/hr.ts index 6dcbf63139..4a1aca279a 100644 --- a/translations/hr.ts +++ b/translations/hr.ts @@ -613,6 +613,26 @@ Ponekad vaša veza možda nije dovoljno dobra da podnese višu kvalitetu videa, Automated translation. Omogući alate za otklanjanje pogrešaka (samo za programere) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimalan broj redaka za kopiranje u međuspremnik kada se pritisne "Kopiraj dnevnik otklanjanja pogrešaka". + + + lines + Automated translation. + crta + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimalna starost (u satima/minutama) redaka dnevnika za kopiranje u međuspremnik kada se pritisne "Kopiraj dnevnik otklanjanja pogrešaka". + + + Max age: + Automated translation. + Max Age: + AppManager diff --git a/translations/hu.ts b/translations/hu.ts index 43f9cf33a9..3efc6106fb 100644 --- a/translations/hu.ts +++ b/translations/hu.ts @@ -611,6 +611,26 @@ ami problémákat okozhat a videohívásokkal kapcsolatban. Automated translation. Hibakereső eszközök engedélyezése (csak fejlesztőknek) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + A vágólapra másolható sorok maximális száma, amikor megnyomja a "Hibakeresési napló másolása" gombot. + + + lines + Automated translation. + vonalak + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + A vágólapra másolható naplósorok maximális kora (órában/percben), amikor megnyomja a "Hibakeresési napló másolása" gombot. + + + Max age: + Automated translation. + Max életkor: + AppManager diff --git a/translations/is.ts b/translations/is.ts index 122116272b..b7369d15f3 100644 --- a/translations/is.ts +++ b/translations/is.ts @@ -700,6 +700,26 @@ sem getur leitt til vandræða með myndsímtöl. Automated translation. Virkja villuleitarverkfæri (aðeins forritarar) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Hámarksfjöldi lína til að afrita á klemmuspjaldið þegar ýtt er á „Afritaðu kembiforrit“. + + + lines + Automated translation. + línur + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Hámarksaldur (á klukkustundum/mínútum) af timburlínum til að afrita á klemmuspjaldið þegar ýtt er á „Afritaðu kembiforrit“. + + + Max age: + Automated translation. + Hámarksaldur: + AppManager @@ -1508,7 +1528,7 @@ svo þú getur vistað skrána á Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3432,7 +3452,7 @@ Fela sniðstafi: px Automated translation. - px + px Theme diff --git a/translations/it.ts b/translations/it.ts index aff11567d6..2f838d088d 100644 --- a/translations/it.ts +++ b/translations/it.ts @@ -591,6 +591,26 @@ il che può portare a problemi con le videochiamate. Automated translation. Abilita strumenti di debug (solo sviluppatori) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Numero massimo di righe da copiare negli appunti quando si preme "Copia il registro di debug". + + + lines + Automated translation. + linee + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Età massima (in ore/minuti) delle righe di registro da copiare negli appunti quando si preme "Copia il registro di debug". + + + Max age: + Automated translation. + Età massima: + AppManager diff --git a/translations/ja.ts b/translations/ja.ts index 82d32c64e9..f71cd91f39 100644 --- a/translations/ja.ts +++ b/translations/ja.ts @@ -621,6 +621,26 @@ which may lead to problems with video calls. Automated translation. デバッグツールを有効にする (開発者のみ) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + 「デバッグログのコピー」を押したときにクリップボードにコピーされる最大行数。 + + + lines + Automated translation. + + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + 「コピーデバッグログ」を押すと、クリップボードにコピーするログラインの最大年齢(時間/分)。 + + + Max age: + Automated translation. + 最大年齢: + AppManager diff --git a/translations/jbo.ts b/translations/jbo.ts index 5a7f2cc796..1feafa0dc9 100644 --- a/translations/jbo.ts +++ b/translations/jbo.ts @@ -710,6 +710,26 @@ so'o roi lo nu do jungau cu na banzu xamgu lo ka zgana lo nu zgana lo vidni Automated translation. fau na akti ti cumki e'u la toks pe la tort ki'u nai ko'a jmina lo kargu be la toks. net gi'e ku'i toljundi ca lo nu sarcu + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + so'i loi lerni poi sarcu lo nu fukpi fi lo bifygau ca lo nu danre lu kopi la debug logu li'u + + + lines + Automated translation. + lerseltcidu + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + lo tcika be li cacra/mentu ku lo logji linji noi sarji lo nu fukyzgau lo bixycpa ca lo nu danre lu kopi la debug logu li'u + + + Max age: + Automated translation. + li makcu nanca: + AppManager @@ -1501,7 +1521,7 @@ e'u do ka'e sfaile lo nu sfaile bu'u la .Windows.zoi ke'a nu MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3420,7 +3440,7 @@ e.g. "**text**" will show as "text", bold. px Automated translation. - px + px Theme diff --git a/translations/kn.ts b/translations/kn.ts index f5a463eeac..ddf6cc5952 100644 --- a/translations/kn.ts +++ b/translations/kn.ts @@ -712,6 +712,26 @@ which may lead to problems with video calls. Automated translation. ಡೀಬಗ್ ಪರಿಕರಗಳನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ (ಡೆವಲಪರ್‌ಗಳು ಮಾತ್ರ) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "ನಕಲಿಸಿ ಡೀಬಗ್ ಲಾಗ್" ಅನ್ನು ಒತ್ತುವಾಗ ಕ್ಲಿಪ್‌ಬೋರ್ಡ್‌ಗೆ ನಕಲಿಸಲು ಗರಿಷ್ಠ ಸಂಖ್ಯೆಯ ಸಾಲುಗಳು. + + + lines + Automated translation. + ಸಾಲುಗಳು + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "ಡೀಬಗ್ ಲಾಗ್ ನಕಲಿಸಿ" ಅನ್ನು ಒತ್ತಿದಾಗ ಕ್ಲಿಪ್‌ಬೋರ್ಡ್‌ಗೆ ನಕಲಿಸಲು ಲಾಗ್ ಲೈನ್‌ಗಳ ಗರಿಷ್ಠ ವಯಸ್ಸು (ಗಂಟೆಗಳು/ನಿಮಿಷಗಳಲ್ಲಿ). + + + Max age: + Automated translation. + ಗರಿಷ್ಠ ವಯಸ್ಸು: + AppManager @@ -1516,7 +1536,7 @@ so you can save the file on Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3447,7 +3467,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/ko.ts b/translations/ko.ts index a57ec55bc9..fad47daf6e 100644 --- a/translations/ko.ts +++ b/translations/ko.ts @@ -637,6 +637,26 @@ which may lead to problems with video calls. Automated translation. 디버그 도구 활성화(개발자 전용) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "디버그 로그 복사"를 누를 때 클립보드에 복사할 최대 줄 수입니다. + + + lines + Automated translation. + 윤곽 + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "디버그 로그 복사"를 누를 때 클립보드에 복사할 로그 줄의 최대 수명(시간/분)입니다. + + + Max age: + Automated translation. + 최대 연령 : + AppManager @@ -1399,7 +1419,7 @@ so you can save the file on Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3283,7 +3303,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/li.ts b/translations/li.ts index 017cda6aa4..61ec236c4f 100644 --- a/translations/li.ts +++ b/translations/li.ts @@ -721,6 +721,26 @@ wat kin leie tot probleme mit videogesprekke. Automated translation. Reset nao de standaardinstellinge + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximaal aantal regels um in ‘t klembord te kopiëre es geer op "Debug Log kopiëre" weurt ingedruk. + + + lines + Automated translation. + lijne + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximale leeftied (in oere/minute) vaan loglijne um in ‘t klembord te kopiëre bij ‘Coppy Debug Log’. + + + Max age: + Automated translation. + Max leeftied: + AppManager @@ -1558,7 +1578,7 @@ in plaats vaan gans te slete. MB Automated translation. - MB + MB Click here if you find errors in a translation and would like to help fix it. @@ -3586,7 +3606,7 @@ Opmaakteikens verberge: px Automated translation. - px + px Theme diff --git a/translations/lt.ts b/translations/lt.ts index 7698c5876c..16e5b414cc 100644 --- a/translations/lt.ts +++ b/translations/lt.ts @@ -592,6 +592,26 @@ dėl to gali kilti vaizdo skambučių problemų. Automated translation. Įgalinti derinimo įrankius (tik kūrėjams) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Didžiausias eilučių, kurias reikia nukopijuoti į mainų sritį, skaičius paspaudus „Kopijuoti derinimo žurnalą“. + + + lines + Automated translation. + linijos + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimalus žurnalo linijų amžius (valandomis/minutėmis), kad galėtumėte nukopijuoti į mainų sritį, paspausdami „Kopijuoti derinimo žurnalą“. + + + Max age: + Automated translation. + Maksimalus amžius: + AppManager diff --git a/translations/lv.ts b/translations/lv.ts index 6e4b3adc2f..194af8af63 100644 --- a/translations/lv.ts +++ b/translations/lv.ts @@ -595,6 +595,26 @@ kas var radīt video zvanu problēmas. Automated translation. Iespējot atkļūdošanas rīkus (tikai izstrādātājiem) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimālais rindu skaits, ko kopēt starpliktuvē, nospiežot "Kopēt atkļūdošanas žurnālu". + + + lines + Automated translation. + līnijas + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimālais žurnāla līniju vecums (stundās/minūtēs), ko kopēt starpliktuvē, nospiežot "Kopēt atkļūdošanas žurnālu". + + + Max age: + Automated translation. + Maksimālais vecums: + AppManager @@ -2937,7 +2957,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/mk.ts b/translations/mk.ts index 49e8e81302..22cef14cf4 100644 --- a/translations/mk.ts +++ b/translations/mk.ts @@ -620,6 +620,26 @@ which may lead to problems with video calls. Automated translation. Овозможи алатки за отстранување грешки (само за програмери) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимален број на линии за копирање во таблата со исечоци при притискање на „Копирај дневник за дебагирање“. + + + lines + Automated translation. + линии + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимална возраст (во часови/минути) на линии на дневници за копирање во таблата со исечоци при притискање на „Copy Debug Log“. + + + Max age: + Automated translation. + Максимална возраст: + AppManager @@ -1318,7 +1338,7 @@ so you can save the file on Windows. MB Automated translation. - МБ + МБ After pressing minimize (_) qTox will minimize to tray, diff --git a/translations/nb_NO.ts b/translations/nb_NO.ts index 56619f727a..d9de258608 100644 --- a/translations/nb_NO.ts +++ b/translations/nb_NO.ts @@ -592,6 +592,26 @@ noe som kan forårsake problemer i videosamtaler. Automated translation. Aktiver feilsøkingsverktøy (bare utviklere) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimalt antall linjer å kopiere til utklippstavlen når du trykker "Kopier feilsøkingslogg". + + + lines + Automated translation. + linjer + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksimal alder (i timer/minutter) på logglinjer som skal kopieres til utklippstavlen når du trykker på "Kopier feilsøkingslogg". + + + Max age: + Automated translation. + Maks alder: + AppManager diff --git a/translations/nl.ts b/translations/nl.ts index 8a56058700..b996337f79 100644 --- a/translations/nl.ts +++ b/translations/nl.ts @@ -589,6 +589,26 @@ wat kan leiden tot problemen met videogesprekken. Enable Debug Tools (developers only) Debugtools inschakelen (alleen voor ontwikkelaars) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximaal aantal regels om naar het klembord te kopiëren bij het drukken op "Debug logboek kopiëren". + + + lines + Automated translation. + lijnen + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximale leeftijd (in uren/minuten) van logregels die naar het klembord moeten worden gekopieerd wanneer op "Copy Debug Log" wordt gedrukt. + + + Max age: + Automated translation. + Maximale leeftijd: + AppManager diff --git a/translations/nl_BE.ts b/translations/nl_BE.ts index 79d26392e8..919247e37d 100644 --- a/translations/nl_BE.ts +++ b/translations/nl_BE.ts @@ -585,6 +585,22 @@ which may lead to problems with video calls. Enable Debug Tools (developers only) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + + + + lines + + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + + + + Max age: + + AppManager diff --git a/translations/pl.ts b/translations/pl.ts index 1cf39be4dd..62d6366435 100644 --- a/translations/pl.ts +++ b/translations/pl.ts @@ -598,6 +598,26 @@ co może powodować problemy z rozmowami wideo. Automated translation. Włącz narzędzia debugowania (tylko programiści) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksymalna liczba linii do skopiowania do schowka podczas nacisku „Kopiuj dziennik debugowania”. + + + lines + Automated translation. + kwestia + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maksymalny wiek (w godzinach/minutach) linii dziennika do skopiowania do schowka podczas nacisku „Kopiuj dziennik debugowania”. + + + Max age: + Automated translation. + Maksymalny wiek: + AppManager diff --git a/translations/pr.ts b/translations/pr.ts index fca52a4f18..eab1e47bbb 100644 --- a/translations/pr.ts +++ b/translations/pr.ts @@ -574,21 +574,37 @@ Take heed, fer higher qualities demand clearer skies and use more bandwidth. If Enable LAN discovery - Find other ships nearby + Find other ships nearby Enable Debug Tools (developers only) - Enable Debug Tools (fer th' shipwrights only) + Enable Debug Tools (fer th' shipwrights only) Connection settings - How ye connect + How ye connect Disabling this allows, e.g., Tox over Tor. It adds load to the Tox network however, so uncheck only when necessary. force tcp checkbox tooltip Disablin' this allows Toxin' over Tor, but it adds load to yer Toxmates. Be thoughtful. + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Limit o' lines to copy when pressin' "Pick up Debug Log". + + + lines + lines + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Oldest age (in hours/minutes) o' log lines to copy when pressin' "Pick up Debug Log". + + + Max age: + Oldest age: + AppManager @@ -1915,7 +1931,7 @@ Press Shift+F1 fer more information. Incoming call - + A'hoy, a call! @@ -3002,7 +3018,7 @@ here may cause th' scroll bar ta vanish. Chat log chunk size - + Chat log piece size Chat log: diff --git a/translations/pt.ts b/translations/pt.ts index 771edd626d..eb44720537 100644 --- a/translations/pt.ts +++ b/translations/pt.ts @@ -591,6 +591,26 @@ o que pode levar a problemas com as vídeo-chamadas. Automated translation. Habilitar ferramentas de depuração (somente desenvolvedores) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Número máximo de linhas para copiar para a área de transferência ao pressionar "Copy Debug Log". + + + lines + Automated translation. + linhas + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Idade máxima (em horas/minutos) de linhas de log para copiar na área de transferência ao pressionar "Copy Debug Log". + + + Max age: + Automated translation. + Idade máxima: + AppManager diff --git a/translations/pt_BR.ts b/translations/pt_BR.ts index 7627e66eb4..6150192412 100644 --- a/translations/pt_BR.ts +++ b/translations/pt_BR.ts @@ -591,6 +591,26 @@ o que pode levar a problemas com as videochamadas. Automated translation. Habilitar ferramentas de depuração (somente desenvolvedores) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Número máximo de linhas a serem copiadas para a área de transferência ao pressionar "Copiar log de depuração". + + + lines + Automated translation. + linhas + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Idade máxima (em horas/minutos) das linhas de log a serem copiadas para a área de transferência ao pressionar "Copiar log de depuração". + + + Max age: + Automated translation. + Idade máxima: + AppManager diff --git a/translations/ro.ts b/translations/ro.ts index 9a9a5200fb..a7d390f918 100644 --- a/translations/ro.ts +++ b/translations/ro.ts @@ -590,6 +590,26 @@ ceea ce poate duce la probleme cu apelurile video. Enable Debug Tools (developers only) Activați instrumentele de depanare (numai pentru dezvoltatori) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Numărul maxim de linii de copiat în clipboard atunci când apăsați „Copy Debug Log”. + + + lines + Automated translation. + linii + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Vârsta maximă (în ore/minute) a liniilor de jurnal pentru a copia în clipboard atunci când apăsați „Copiați jurnalul de depanare”. + + + Max age: + Automated translation. + Vârsta maximă: + AppManager diff --git a/translations/ru.ts b/translations/ru.ts index 18dd7d47f2..e74aa174ba 100644 --- a/translations/ru.ts +++ b/translations/ru.ts @@ -591,6 +591,26 @@ which may lead to problems with video calls. Enable Debug Tools (developers only) Включить Инструменты Отладки (только для разработчиков) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимальное количество строк для копирования в буфер обмена при нажатии «Журнал отладки копирования». + + + lines + Automated translation. + линии + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимальный возраст (в часах/минутах) строк журнала, которые можно скопировать в буфер обмена при нажатии «Копировать журнал отладки». + + + Max age: + Automated translation. + Максимальный возраст: + AppManager diff --git a/translations/si.ts b/translations/si.ts index 7a424200a9..0fd16e8632 100644 --- a/translations/si.ts +++ b/translations/si.ts @@ -718,6 +718,26 @@ which may lead to problems with video calls. Automated translation. නිදොස් කිරීමේ මෙවලම් සබල කරන්න (සංවර්ධකයින් පමණි) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "පිටපත් ඩ්රග් ලොග්" එබූ විට ක්ලිප් පුවරුවට පිටපත් කිරීමට උපරිම පේළි ගණන. + + + lines + Automated translation. + රේඛා + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "නිදොස් ලොගය පිටපත් කරන්න" එබූ විට පසුරු පුවරුවට පිටපත් කිරීමට ලොග් රේඛාවල උපරිම වයස (පැය/විනාඩි වලින්). + + + Max age: + Automated translation. + උපරිම වයස: + AppManager @@ -1526,7 +1546,7 @@ so you can save the file on Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3463,7 +3483,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/sk.ts b/translations/sk.ts index ec6fb0493b..83f5e8ffd0 100644 --- a/translations/sk.ts +++ b/translations/sk.ts @@ -592,6 +592,26 @@ Rýchlosť vášho pripojenia nemusí byť vždy dostačujúca pre vyššiu kval Automated translation. Povoliť nástroje na ladenie (len pre vývojárov) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximálny počet riadkov na skopírovanie do schránky pri stlačení „Kopírujte debug protokol“. + + + lines + Automated translation. + čiarka + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximálny vek (v hodinách/minútach) riadkov denníka, ktoré sa majú skopírovať do schránky pri stlačení tlačidla „Kopírovať denník ladenia“. + + + Max age: + Automated translation. + Maximálny vek: + AppManager diff --git a/translations/sl.ts b/translations/sl.ts index a9313862b3..471ef3645e 100644 --- a/translations/sl.ts +++ b/translations/sl.ts @@ -626,6 +626,26 @@ kar lahko povzroči težave z video klici. Automated translation. Omogoči orodja za odpravljanje napak (samo za razvijalce) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Največje število vrstic za kopiranje v odložišče, ko pritisnete "Kopiraj dnevnik odpravljanja napak". + + + lines + Automated translation. + črte + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Največja starost (v urah/minutah) dnevnikov, ki jih lahko kopirate v odložišče, ko pritisnete "Kopiraj dnevnik napak". + + + Max age: + Automated translation. + Največja starost: + AppManager @@ -1326,7 +1346,7 @@ tako da lahko datoteko shranite v sistem Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, diff --git a/translations/sq.ts b/translations/sq.ts index c321c7d8de..aca8eafcb4 100644 --- a/translations/sq.ts +++ b/translations/sq.ts @@ -713,6 +713,26 @@ gjë që mund të çojë në probleme me video thirrjet. Automated translation. Aktivizo mjetet e korrigjimit (vetëm për zhvilluesit) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Numri maksimal i rreshtave për t'u kopjuar në kujtesën e fragmenteve kur shtypni "Copy Debug Log". + + + lines + Automated translation. + linjat + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Mosha maksimale (në orë/minuta) e linjave log për të kopjuar në clipboard kur shtypni "Kopjoni Log Debug Log". + + + Max age: + Automated translation. + Mosha Max: + AppManager @@ -1521,7 +1541,7 @@ kështu që mund ta ruani skedarin në Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3458,7 +3478,7 @@ Fshih karakteret e formatimit: px Automated translation. - px + px Theme diff --git a/translations/sr.ts b/translations/sr.ts index e5276ded80..2df87cbe1c 100644 --- a/translations/sr.ts +++ b/translations/sr.ts @@ -613,6 +613,26 @@ which may lead to problems with video calls. Automated translation. Омогући алате за отклањање грешака (само за програмере) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимални број линија за копирање у међуспремник приликом притиска "Копирајте дневник за уклањање погрешака". + + + lines + Automated translation. + линије + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимална старост (у сатима/минутима) редова дневника за копирање у међуспремник када се притисне „Копирај дневник отклањања грешака“. + + + Max age: + Automated translation. + Максимална старост: + AppManager diff --git a/translations/sr_Latn.ts b/translations/sr_Latn.ts index b0ee1ce7d9..2d85cc4191 100644 --- a/translations/sr_Latn.ts +++ b/translations/sr_Latn.ts @@ -586,6 +586,22 @@ which may lead to problems with video calls. Enable Debug Tools (developers only) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + + + + lines + + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + + + + Max age: + + AppManager diff --git a/translations/sv.ts b/translations/sv.ts index 7a909bd3ea..ced4ad9b75 100644 --- a/translations/sv.ts +++ b/translations/sv.ts @@ -591,6 +591,26 @@ vilket kan leda till problem med videosamtal. Automated translation. Aktivera felsökningsverktyg (endast utvecklare) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximalt antal rader för att kopiera till urklippet när du trycker på "Kopieringsfelsökningslogg". + + + lines + Automated translation. + rader + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Maximal ålder (i timmar/minuter) av loglinjer för att kopiera till urklippet när du trycker på "Kopieringsfelsökningslogg". + + + Max age: + Automated translation. + Max ålder: + AppManager diff --git a/translations/sw.ts b/translations/sw.ts index 64ab690cd6..6f8b48044f 100644 --- a/translations/sw.ts +++ b/translations/sw.ts @@ -720,6 +720,26 @@ ambayo inaweza kusababisha matatizo na simu za video. Automated translation. Washa Zana za Utatuzi (wasanidi pekee) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Idadi ya juu ya mistari ya kunakili kwenye clipboard wakati wa kubonyeza "Nakala ya Debug Log". + + + lines + Automated translation. + mistari + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Umri wa juu zaidi (katika saa/dakika) wa mistari ya kumbukumbu ili kunakili kwenye ubao wa kunakili unapobofya "Nakili Rekodi ya Utatuzi". + + + Max age: + Automated translation. + Umri wa juu zaidi: + AppManager @@ -1528,7 +1548,7 @@ kwa hivyo unaweza kuhifadhi faili kwenye Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3465,7 +3485,7 @@ Ficha vibambo vya uumbizaji: px Automated translation. - px + px Theme diff --git a/translations/ta.ts b/translations/ta.ts index 017a881be9..d069741ee8 100644 --- a/translations/ta.ts +++ b/translations/ta.ts @@ -636,6 +636,26 @@ qTox இல் தாங்கள் சிக்கலோ பாதுகாப Automated translation. பிழைத்திருத்த கருவிகளை இயக்கு (டெவலப்பர்கள் மட்டும்) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "பிழைத்திருத்தப் பதிவை நகலெடு" என்பதை அழுத்தும் போது, ​​கிளிப்போர்டில் நகலெடுக்க வேண்டிய வரிகளின் அதிகபட்ச எண்ணிக்கை. + + + lines + Automated translation. + வரிகள் + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "பிழைத்திருத்தப் பதிவை நகலெடு" என்பதை அழுத்தும் போது கிளிப்போர்டில் நகலெடுக்க பதிவு வரிகளின் அதிகபட்ச வயது (மணி/நிமிடங்களில்). + + + Max age: + Automated translation. + அதிகபட்ச வயது: + AppManager @@ -1338,7 +1358,7 @@ so you can save the file on Windows. MB Automated translation. - எம்பி + எம்பி After pressing minimize (_) qTox will minimize to tray, @@ -3214,7 +3234,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/tr.ts b/translations/tr.ts index d123d43a89..56ecee6375 100644 --- a/translations/tr.ts +++ b/translations/tr.ts @@ -593,6 +593,26 @@ bu da video görüşmelerinde sorunlara yol açabilir. Automated translation. Hata Ayıklama Araçlarını Etkinleştir (yalnızca geliştiriciler) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "Hata Ayıklama Günlüğünü Kopyala"ya basıldığında panoya kopyalanacak maksimum satır sayısı. + + + lines + Automated translation. + çizgiler + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "Hata Ayıklama Günlüğünü Kopyala" düğmesine basıldığında panoya kopyalanacak günlük satırlarının maksimum yaşı (saat/dakika cinsinden). + + + Max age: + Automated translation. + Max Age: + AppManager diff --git a/translations/ug.ts b/translations/ug.ts index 54e16dd8af..0699fd7329 100644 --- a/translations/ug.ts +++ b/translations/ug.ts @@ -620,6 +620,26 @@ which may lead to problems with video calls. Automated translation. ھەل قىلىش قوراللىرىنى قوزغىتىڭ (ئاچقۇچىلارلا) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + «خاتالىق خاتىرىسىنى كۆچۈرۈش» نى باسقاندا چاپلاش تاختىسىغا كۆچۈرمەكچى بولغان ئەڭ كۆپ قۇر. + + + lines + Automated translation. + قۇر + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + ئەڭ يۇقىرى ياش (بىر نەچچە سائەت / مىنۇت) لىنىيىسى (سائەتلىك / مىنۇتلۇق ۋاقىت) ئارقىلىق «بىر نەچچە سائەت / مىنۇتلۇق ۋاقىت» نى چېكىپ, «بىر نەچچە سائەت / مىنۇتلۇق ۋاقىت» نى چېكىپ, چاپلاش تاختىسى ئارقىلىق چاپلاش تاختىسىغا يۆتكىلىدۇ. + + + Max age: + Automated translation. + ئەڭ چوڭ يېشى: + AppManager @@ -1316,7 +1336,7 @@ so you can save the file on Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, diff --git a/translations/uk.ts b/translations/uk.ts index b9264f7cc9..467e9ae005 100644 --- a/translations/uk.ts +++ b/translations/uk.ts @@ -590,6 +590,26 @@ which may lead to problems with video calls. Enable Debug Tools (developers only) Увімкнути Інструменти Відладки (тільки для розробників) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимальна кількість рядків для копіювання в буфер обміну при натисканні "Копіювати журнал налагодження". + + + lines + Automated translation. + лінії + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Максимальний вік (у години/хвилини) рядків журналу для копіювання в буфер обміну при натисканні "Копіювати журнал налагодження". + + + Max age: + Automated translation. + Максимальний вік: + AppManager diff --git a/translations/ur.ts b/translations/ur.ts index 8170bf8f0e..df25581611 100644 --- a/translations/ur.ts +++ b/translations/ur.ts @@ -694,6 +694,26 @@ which may lead to problems with video calls. Automated translation. ڈیبگ ٹولز کو فعال کریں (صرف ڈویلپرز) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "کاپی ڈیبگ لاگ" دبانے پر کلپ بورڈ میں کاپی کرنے کے لیے لائنوں کی زیادہ سے زیادہ تعداد۔ + + + lines + Automated translation. + لائنیں + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + "کاپی ڈیبگ لاگ" دبانے پر کلپ بورڈ میں کاپی کرنے کے لیے لاگ لائنوں کی زیادہ سے زیادہ عمر (گھنٹوں/منٹ میں)۔ + + + Max age: + Automated translation. + زیادہ سے زیادہ عمر: + AppManager @@ -1502,7 +1522,7 @@ so you can save the file on Windows. MB Automated translation. - ایم بی + ایم بی After pressing minimize (_) qTox will minimize to tray, @@ -3439,7 +3459,7 @@ Hide formatting characters: px Automated translation. - px + px Theme diff --git a/translations/vi.ts b/translations/vi.ts index f6f673bac6..f15c86bc77 100644 --- a/translations/vi.ts +++ b/translations/vi.ts @@ -590,6 +590,26 @@ có thể dẫn đến sự cố với cuộc gọi điện video. Automated translation. Bật Công cụ gỡ lỗi (chỉ dành cho nhà phát triển) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Số dòng tối đa để sao chép vào bảng nhớ tạm khi nhấn "Sao chép nhật ký gỡ lỗi". + + + lines + Automated translation. + dòng + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + Tuổi tối đa (tính bằng giờ/phút) của các dòng nhật ký để sao chép vào bảng tạm khi nhấn "Bản sao bản gỡ lỗi bản sao". + + + Max age: + Automated translation. + Tuổi tối đa: + AppManager diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index c8b5c045e6..1d68a2d986 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -588,6 +588,26 @@ which may lead to problems with video calls. Enable Debug Tools (developers only) 启用调试工具(仅限开发人员) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + 按“复制调试日志”时复制到剪贴板的最大行数。 + + + lines + Automated translation. + 线 + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + 按“复制调试日志”时复制到剪贴板的日志行的最长期限(以小时/分钟为单位)。 + + + Max age: + Automated translation. + 最大年龄: + AppManager diff --git a/translations/zh_TW.ts b/translations/zh_TW.ts index 24ee212b15..14d00b7778 100644 --- a/translations/zh_TW.ts +++ b/translations/zh_TW.ts @@ -655,6 +655,26 @@ which may lead to problems with video calls. Automated translation. 啟用調試工具(僅限開發人員) + + Maximum number of lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + 按下“複製調試日誌”時,將最大數量複製到剪貼板中。 + + + lines + Automated translation. + + + + Maximum age (in hours/minutes) of log lines to copy into the clipboard when pressing "Copy Debug Log". + Automated translation. + 按下「複製偵錯日誌」時複製到剪貼簿的日誌行的最長期限(以小時/分鐘為單位)。 + + + Max age: + Automated translation. + 最大年齡: + AppManager @@ -1424,7 +1444,7 @@ so you can save the file on Windows. MB Automated translation. - MB + MB After pressing minimize (_) qTox will minimize to tray, @@ -3328,7 +3348,7 @@ Hide formatting characters: px Automated translation. - 像素 + 像素 Theme diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index dc0bb34003..2e13087a5c 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -8,6 +8,8 @@ add_library( util_library STATIC include/util/algorithm.h src/algorithm.cpp + include/util/fileutil.h + src/fileutil.cpp include/util/interface.h include/util/ranges.h src/ranges.cpp diff --git a/util/include/util/fileutil.h b/util/include/util/fileutil.h new file mode 100644 index 0000000000..9019588509 --- /dev/null +++ b/util/include/util/fileutil.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * Copyright © 2025 The TokTok team. + */ + +#pragma once + +template +class QList; +class QString; + +namespace FileUtil { +QList tail(const QString& filename, int count); +} // namespace FileUtil diff --git a/util/src/fileutil.cpp b/util/src/fileutil.cpp new file mode 100644 index 0000000000..e7c2bee082 --- /dev/null +++ b/util/src/fileutil.cpp @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * Copyright © 2025 The TokTok team. + */ + +#include "util/fileutil.h" + +#include +#include +#include +#include +#include + +QStringList FileUtil::tail(const QString& filename, int count) +{ + if (count <= 0) { + return {}; + } + + QFile file{filename}; + if (!file.exists()) { + qDebug() << "File" << filename << "does not exist"; + return {}; + } + + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + qDebug() << "Unable to open file" << filename; + return {}; + } + + // This could be made more efficient. We don't need to read the whole file, + // but we use this function rarely, so it's not a priority. Clarity of the + // code is more important here. + QStringList lines; + QTextStream in(&file); + while (!in.atEnd()) { + lines.append(in.readLine()); + } + + if (lines.isEmpty()) { + qDebug() << "File" << filename << "is empty"; + return {}; + } + + if (lines.size() <= count) { + return lines; + } + + return lines.mid(lines.size() - count); +}