Prevent ChatView from scrolling up 1px on buffer switch, fixes #544
[quassel.git] / src / common / network.h
index c924953..704d67a 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   Copyright (C) 2005-09 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -203,6 +203,10 @@ public:
   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);
@@ -350,12 +354,17 @@ private:
 
   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 {
+  // set some default values, note that this does not initialize e.g. name and id
+  NetworkInfo();
+
   NetworkId networkId;
   QString networkName;
   IdentityId identity;
@@ -365,7 +374,6 @@ struct NetworkInfo {
   QByteArray codecForEncoding;
   QByteArray codecForDecoding;
 
-  // Server entry: QString "Host", uint "Port", QString "Password", bool "UseSSL"
   Network::ServerList serverList;
   bool useRandomServer;