File indexing completed on 2024-05-12 05:29:27
0001 // SPDX-FileCopyrightText: 2019, 2022 Mikhail Zolotukhin <zomial@protonmail.com> 0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0003 0004 #include "utils.h" 0005 0006 #include <QStandardPaths> 0007 0008 namespace Utils 0009 { 0010 0011 QString configDirPath(int gtkVersion) 0012 { 0013 auto configLocation = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); 0014 return QStringLiteral("%1/gtk-%2.0").arg(configLocation).arg(gtkVersion); 0015 }; 0016 0017 QString readFileContents(QFile &file) 0018 { 0019 if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { 0020 return file.readAll(); 0021 } else { 0022 return QString(); 0023 } 0024 } 0025 0026 }