File indexing completed on 2024-04-28 05:50:45
0001 /* 0002 This source file is part of Konsole, a terminal emulator. 0003 0004 SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef PROFILEREADER_H 0010 #define PROFILEREADER_H 0011 0012 #include "Profile.h" 0013 0014 class KConfig; 0015 0016 namespace Konsole 0017 { 0018 /** Interface for all classes which can load profile settings from a file. */ 0019 class KONSOLEPRIVATE_EXPORT ProfileReader 0020 { 0021 public: 0022 ProfileReader(); 0023 ~ProfileReader(); 0024 0025 /** Returns a list of paths to profiles which this reader can read. */ 0026 QStringList findProfiles(); 0027 0028 /** 0029 * Attempts to read a profile from @p path and 0030 * save the property values described into @p profile. 0031 * 0032 * Returns true if the profile was successfully read or false otherwise. 0033 * 0034 * @param path Path to the profile to read 0035 * @param profile Pointer to the Profile the settings will be read into 0036 * @param parentProfile Receives the name of the parent profile 0037 */ 0038 bool readProfile(const QString &path, Profile::Ptr profile, QString &parentProfile); 0039 0040 private: 0041 void readProperties(const KConfig &config, Profile::Ptr profile); 0042 }; 0043 } 0044 0045 #endif // PROFILEREADER_H