Remove "CompletionManager". Completion models are now stored in Channel
Chatters list is now updated every 5 minutes
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
#include "common.hpp"
|
||||
#include "debug/log.hpp"
|
||||
#include "singletons/channelmanager.hpp"
|
||||
#include "singletons/completionmanager.hpp"
|
||||
#include "singletons/emotemanager.hpp"
|
||||
|
||||
#include <QtAlgorithms>
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
|
||||
CompletionModel::CompletionModel(const QString &_channelName)
|
||||
: channelName(_channelName)
|
||||
{
|
||||
@@ -94,5 +94,6 @@ void CompletionModel::addUser(const QString &str)
|
||||
// Always add a space at the end of completions
|
||||
this->emotes.insert(this->createUser(str + " "));
|
||||
}
|
||||
|
||||
} // namespace singletons
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <set>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
#include <QAbstractListModel>
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
|
||||
class CompletionModel : public QAbstractListModel
|
||||
{
|
||||
public:
|
||||
@@ -50,17 +51,23 @@ private:
|
||||
if (this->isEmote) {
|
||||
if (that.isEmote) {
|
||||
int k = QString::compare(this->str, that.str, Qt::CaseInsensitive);
|
||||
if (k == 0) return this->str > that.str;
|
||||
else return k < 0;
|
||||
if (k == 0) {
|
||||
return this->str > that.str;
|
||||
} else {
|
||||
return k < 0;
|
||||
}
|
||||
} else
|
||||
return true;
|
||||
} else {
|
||||
if (that.isEmote)
|
||||
return false;
|
||||
else {
|
||||
int k = QString::compare(this->str, that.str, Qt::CaseInsensitive);;
|
||||
if (k == 0) return this->str > that.str;
|
||||
else return k < 0;
|
||||
int k = QString::compare(this->str, that.str, Qt::CaseInsensitive);
|
||||
if (k == 0) {
|
||||
return this->str > that.str;
|
||||
} else {
|
||||
return k < 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,5 +88,6 @@ private:
|
||||
|
||||
QString channelName;
|
||||
};
|
||||
|
||||
} // namespace singletons
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user