-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #3367
- Loading branch information
Showing
26 changed files
with
1,296 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "connectiongroup.h" | ||
|
||
#include "connections-tree/items/servergroup.h" | ||
|
||
ConnectionGroup::ConnectionGroup(QSharedPointer<ConnectionsTree::ServerGroup> g) | ||
: m_group(g) {} | ||
|
||
ConnectionGroup::ConnectionGroup() : m_group(nullptr) {} | ||
|
||
QString ConnectionGroup::name() const { | ||
if (!m_group) return QString(); | ||
|
||
return m_group->getDisplayName(); | ||
} | ||
|
||
void ConnectionGroup::setName(const QString &n) { | ||
if (m_group) m_group->setName(n); | ||
} | ||
|
||
QSharedPointer<ConnectionsTree::ServerGroup> ConnectionGroup::serverGroup() const { | ||
return m_group; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
#include <QObject> | ||
#include <QSharedPointer> | ||
|
||
namespace ConnectionsTree { | ||
class ServerGroup; | ||
} | ||
|
||
class ConnectionGroup { | ||
Q_GADGET | ||
|
||
Q_PROPERTY(QString name READ name WRITE setName) | ||
|
||
public: | ||
ConnectionGroup(); | ||
|
||
ConnectionGroup(QSharedPointer<ConnectionsTree::ServerGroup> g); | ||
|
||
QString name() const; | ||
|
||
void setName(const QString& n); | ||
|
||
QSharedPointer<ConnectionsTree::ServerGroup> serverGroup() const; | ||
|
||
private: | ||
QSharedPointer<ConnectionsTree::ServerGroup> m_group; | ||
}; | ||
|
||
Q_DECLARE_METATYPE(ConnectionGroup) |
Oops, something went wrong.