-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
uploadprofileitem.h
66 lines (53 loc) · 1.86 KB
/
uploadprofileitem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/***************************************************************************
* Copyright 2007 Niko Sams <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef UPLOADPROFILEITEM_H
#define UPLOADPROFILEITEM_H
#include <QStandardItem>
class QUrl;
class KConfigGroup;
class UploadProfileItem : public QStandardItem
{
enum {
UrlRole = Qt::UserRole+1,
IsDefaultRole,
ProfileNrRole,
LocalUrlRole
};
public:
UploadProfileItem();
~UploadProfileItem() override {}
void setUrl(const QUrl& url);
void setLocalUrl(const QUrl& url);
/**
* Set if this item is the default upload-profile.
* Sets default to false for all other items in this model
*/
void setDefault(bool isDefault);
/**
* Set the profile-number, which is used as group-name in the config
*/
void setProfileNr(const QString& nr);
QUrl url() const;
QUrl localUrl() const;
bool isDefault() const;
/**
* Returns the profile-number, which is used as group-name in the config
*/
QString profileNr() const;
/**
* Returns the KConfigGroup for this upload profile if one exists
*/
KConfigGroup profileConfigGroup() const;
int type() const override {
return UserType+1;
}
};
#endif
// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on