mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(chatform): Use IChatLog to get date in GenericChatForm
* Allows for deletion of APIs returning ChatLine::Ptr from ChatLog * Bonus removal of unused "getFirstTime" function from GenericChatForm
This commit is contained in:
parent
ef47c00c8d
commit
d0f4c336ba
|
@ -595,27 +595,6 @@ ChatLine::Ptr ChatLog::getTypingNotification() const
|
|||
return typingNotification;
|
||||
}
|
||||
|
||||
QVector<ChatLine::Ptr> ChatLog::getLines()
|
||||
{
|
||||
return lines;
|
||||
}
|
||||
|
||||
ChatLine::Ptr ChatLog::getLatestLine() const
|
||||
{
|
||||
if (!lines.empty()) {
|
||||
return lines.last();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ChatLine::Ptr ChatLog::getFirstLine() const
|
||||
{
|
||||
if (!lines.empty()) {
|
||||
return lines.first();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Finds the chat line object at a position on screen
|
||||
* @param pos Position on screen in global coordinates
|
||||
|
|
|
@ -67,9 +67,6 @@ public:
|
|||
bool hasTextToBeCopied() const;
|
||||
|
||||
ChatLine::Ptr getTypingNotification() const;
|
||||
QVector<ChatLine::Ptr> getLines();
|
||||
ChatLine::Ptr getLatestLine() const;
|
||||
ChatLine::Ptr getFirstLine() const;
|
||||
ChatLineContent* getContentFromGlobalPos(QPoint pos) const;
|
||||
const uint repNameAfter = 5 * 60;
|
||||
|
||||
|
|
|
@ -402,12 +402,10 @@ void GenericChatForm::hideFileMenu()
|
|||
|
||||
QDateTime GenericChatForm::getLatestTime() const
|
||||
{
|
||||
return getTime(chatWidget->getLatestLine());
|
||||
}
|
||||
if (chatLog.getFirstIdx() == chatLog.getNextIdx())
|
||||
return QDateTime();
|
||||
|
||||
QDateTime GenericChatForm::getFirstTime() const
|
||||
{
|
||||
return getTime(chatWidget->getFirstLine());
|
||||
return chatLog.at(chatLog.getNextIdx() - 1).getTimestamp();
|
||||
}
|
||||
|
||||
void GenericChatForm::reloadTheme()
|
||||
|
|
|
@ -80,7 +80,6 @@ public:
|
|||
const QDateTime& datetime);
|
||||
static QString resolveToxPk(const ToxPk& pk);
|
||||
QDateTime getLatestTime() const;
|
||||
QDateTime getFirstTime() const;
|
||||
|
||||
signals:
|
||||
void messageInserted();
|
||||
|
|
Loading…
Reference in New Issue
Block a user