File indexing completed on 2024-04-28 08:27:02
0001 /*************************************************************************** 0002 * Copyright 2007 Niko Sams <niko.sams@gmail.com> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU General Public License as published by * 0006 * the Free Software Foundation; either version 2 of the License, or * 0007 * (at your option) any later version. * 0008 * * 0009 ***************************************************************************/ 0010 0011 #ifndef UPLOADPROFILEITEM_H 0012 #define UPLOADPROFILEITEM_H 0013 0014 #include <QStandardItem> 0015 0016 class QUrl; 0017 class KConfigGroup; 0018 0019 class UploadProfileItem : public QStandardItem 0020 { 0021 enum { 0022 UrlRole = Qt::UserRole+1, 0023 IsDefaultRole, 0024 ProfileNrRole, 0025 LocalUrlRole 0026 }; 0027 public: 0028 UploadProfileItem(); 0029 ~UploadProfileItem() override {} 0030 0031 void setUrl(const QUrl& url); 0032 void setLocalUrl(const QUrl& url); 0033 0034 /** 0035 * Set if this item is the default upload-profile. 0036 * Sets default to false for all other items in this model 0037 */ 0038 void setDefault(bool isDefault); 0039 0040 /** 0041 * Set the profile-number, which is used as group-name in the config 0042 */ 0043 void setProfileNr(const QString& nr); 0044 0045 QUrl url() const; 0046 QUrl localUrl() const; 0047 bool isDefault() const; 0048 0049 /** 0050 * Returns the profile-number, which is used as group-name in the config 0051 */ 0052 QString profileNr() const; 0053 0054 /** 0055 * Returns the KConfigGroup for this upload profile if one exists 0056 */ 0057 KConfigGroup profileConfigGroup() const; 0058 0059 int type() const override { 0060 return UserType+1; 0061 } 0062 }; 0063 0064 0065 #endif 0066 // kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on