summaryrefslogtreecommitdiffstats
path: root/logic/updater/UpdateChecker.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-04-10 04:29:29 +0200
committerPetr Mrázek <peterix@gmail.com>2016-04-30 23:59:23 +0200
commit47e37635f50c09b4f9a9ee7699e3120bab3e4088 (patch)
tree061c2f675fb7e244ebe4b54ef206bfbd615c91f8 /logic/updater/UpdateChecker.h
parentfcd4a482f759cd58ee319a51082d0146b7e426e2 (diff)
downloadMultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.gz
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.lz
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.xz
MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.zip
NOISSUE split GUI stuff from logic library
Diffstat (limited to 'logic/updater/UpdateChecker.h')
-rw-r--r--logic/updater/UpdateChecker.h121
1 files changed, 0 insertions, 121 deletions
diff --git a/logic/updater/UpdateChecker.h b/logic/updater/UpdateChecker.h
deleted file mode 100644
index c7fad10e..00000000
--- a/logic/updater/UpdateChecker.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Copyright 2013-2015 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "net/NetJob.h"
-#include "GoUpdate.h"
-
-#include <QUrl>
-
-#include "multimc_logic_export.h"
-
-class MULTIMC_LOGIC_EXPORT UpdateChecker : public QObject
-{
- Q_OBJECT
-
-public:
- UpdateChecker(QString channelListUrl, QString currentChannel, int currentBuild);
- void checkForUpdate(QString updateChannel, bool notifyNoUpdate);
-
- /*!
- * Causes the update checker to download the channel list from the URL specified in config.h (generated by CMake).
- * If this isn't called before checkForUpdate(), it will automatically be called.
- */
- void updateChanList(bool notifyNoUpdate);
-
- /*!
- * An entry in the channel list.
- */
- struct ChannelListEntry
- {
- QString id;
- QString name;
- QString description;
- QString url;
- };
-
- /*!
- * Returns a the current channel list.
- * If the channel list hasn't been loaded, this list will be empty.
- */
- QList<ChannelListEntry> getChannelList() const;
-
- /*!
- * Returns false if the channel list is empty.
- */
- bool hasChannels() const;
-
-signals:
- //! Signal emitted when an update is available. Passes the URL for the repo and the ID and name for the version.
- void updateAvailable(GoUpdate::Status status);
-
- //! Signal emitted when the channel list finishes loading or fails to load.
- void channelListLoaded();
-
- void noUpdateFound();
-
-private slots:
- void updateCheckFinished(bool notifyNoUpdate);
- void updateCheckFailed();
-
- void chanListDownloadFinished(bool notifyNoUpdate);
- void chanListDownloadFailed(QString reason);
-
-private:
- friend class UpdateCheckerTest;
-
- NetJobPtr indexJob;
- NetJobPtr chanListJob;
-
- QString m_channelListUrl;
-
- QList<ChannelListEntry> m_channels;
-
- /*!
- * True while the system is checking for updates.
- * If checkForUpdate is called while this is true, it will be ignored.
- */
- bool m_updateChecking;
-
- /*!
- * True if the channel list has loaded.
- * If this is false, trying to check for updates will call updateChanList first.
- */
- bool m_chanListLoaded;
-
- /*!
- * Set to true while the channel list is currently loading.
- */
- bool m_chanListLoading;
-
- /*!
- * Set to true when checkForUpdate is called while the channel list isn't loaded.
- * When the channel list finishes loading, if this is true, the update checker will check for updates.
- */
- bool m_checkUpdateWaiting;
-
- /*!
- * if m_checkUpdateWaiting, this is the last used update channel
- */
- QString m_deferredUpdateChannel;
-
- int m_currentBuild = -1;
- QString m_currentChannel;
- QString m_currentRepoUrl;
-
- QString m_newRepoUrl;
-};
-