* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "corealiasmanager.h"
***************************************************************************/
#include "corealiasmanager.h"
- CoreSession *session = qobject_cast<CoreSession *>(parent);
- if(!session) {
- qWarning() << "CoreAliasManager: unable to load Aliases. Parent is not a Coresession!";
- loadDefaults();
- return;
- }
+ auto* session = qobject_cast<CoreSession*>(parent);
+ if (!session) {
+ qWarning() << "CoreAliasManager: unable to load Aliases. Parent is not a Coresession!";
+ loadDefaults();
+ return;
+ }
- // we store our settings whenever they change
- connect(this, SIGNAL(updatedRemotely()), SLOT(save()));
+ // we store our settings whenever they change
+ connect(this, &SyncableObject::updatedRemotely, this, &CoreAliasManager::save);
-void CoreAliasManager::save() const {
- CoreSession *session = qobject_cast<CoreSession *>(parent());
- if(!session) {
- qWarning() << "CoreAliasManager: unable to save Aliases. Parent is not a Coresession!";
- return;
- }
+void CoreAliasManager::save() const
+{
+ auto* session = qobject_cast<CoreSession*>(parent());
+ if (!session) {
+ qWarning() << "CoreAliasManager: unable to save Aliases. Parent is not a Coresession!";
+ return;
+ }
-const Network *CoreAliasManager::network(NetworkId id) const {
- return qobject_cast<CoreSession *>(parent())->network(id);
+const Network* CoreAliasManager::network(NetworkId id) const
+{
+ return qobject_cast<CoreSession*>(parent())->network(id);
-void CoreAliasManager::loadDefaults() {
- foreach(Alias alias, AliasManager::defaults()) {
- addAlias(alias.name, alias.expansion);
- }
+void CoreAliasManager::loadDefaults()
+{
+ foreach (Alias alias, AliasManager::defaults()) {
+ addAlias(alias.name, alias.expansion);
+ }