Move handling of networks.ini from NetworksSettingsPage in Network
[quassel.git] / src / common / network.h
index bee38e9..704d67a 100644 (file)
@@ -203,6 +203,10 @@ public:
   inline bool autoAwayActive() const { return _autoAwayActive; }
   inline void setAutoAwayActive(bool active) { _autoAwayActive = active; }
 
   inline bool autoAwayActive() const { return _autoAwayActive; }
   inline void setAutoAwayActive(bool active) { _autoAwayActive = active; }
 
+  static QStringList presetNetworks(bool onlyDefault = false);
+  static QStringList presetDefaultChannels(const QString &networkName);
+  static NetworkInfo networkInfoFromPreset(const QString &networkName);
+
 public slots:
   void setNetworkName(const QString &networkName);
   void setCurrentServer(const QString &currentServer);
 public slots:
   void setNetworkName(const QString &networkName);
   void setCurrentServer(const QString &currentServer);
@@ -350,12 +354,17 @@ private:
 
   bool _autoAwayActive; // when this is active handle305 and handle306 don't trigger any output
 
 
   bool _autoAwayActive; // when this is active handle305 and handle306 don't trigger any output
 
+  static QString _networksIniPath;
+
   friend class IrcUser;
   friend class IrcChannel;
 };
 
 //! Stores all editable information about a network (as opposed to runtime state).
 struct NetworkInfo {
   friend class IrcUser;
   friend class IrcChannel;
 };
 
 //! Stores all editable information about a network (as opposed to runtime state).
 struct NetworkInfo {
+  // set some default values, note that this does not initialize e.g. name and id
+  NetworkInfo();
+
   NetworkId networkId;
   QString networkName;
   IdentityId identity;
   NetworkId networkId;
   QString networkName;
   IdentityId identity;
@@ -365,7 +374,6 @@ struct NetworkInfo {
   QByteArray codecForEncoding;
   QByteArray codecForDecoding;
 
   QByteArray codecForEncoding;
   QByteArray codecForDecoding;
 
-  // Server entry: QString "Host", uint "Port", QString "Password", bool "UseSSL"
   Network::ServerList serverList;
   bool useRandomServer;
 
   Network::ServerList serverList;
   bool useRandomServer;