mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #6294
Mick Sayson (1): refactor(chatform): Use IChatLog to get date in GenericChatForm
This commit is contained in:
commit
fe421d11a1
|
@ -595,27 +595,6 @@ ChatLine::Ptr ChatLog::getTypingNotification() const
|
||||||
return typingNotification;
|
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
|
* @brief Finds the chat line object at a position on screen
|
||||||
* @param pos Position on screen in global coordinates
|
* @param pos Position on screen in global coordinates
|
||||||
|
|
|
@ -67,9 +67,6 @@ public:
|
||||||
bool hasTextToBeCopied() const;
|
bool hasTextToBeCopied() const;
|
||||||
|
|
||||||
ChatLine::Ptr getTypingNotification() const;
|
ChatLine::Ptr getTypingNotification() const;
|
||||||
QVector<ChatLine::Ptr> getLines();
|
|
||||||
ChatLine::Ptr getLatestLine() const;
|
|
||||||
ChatLine::Ptr getFirstLine() const;
|
|
||||||
ChatLineContent* getContentFromGlobalPos(QPoint pos) const;
|
ChatLineContent* getContentFromGlobalPos(QPoint pos) const;
|
||||||
const uint repNameAfter = 5 * 60;
|
const uint repNameAfter = 5 * 60;
|
||||||
|
|
||||||
|
|
|
@ -404,12 +404,10 @@ void GenericChatForm::hideFileMenu()
|
||||||
|
|
||||||
QDateTime GenericChatForm::getLatestTime() const
|
QDateTime GenericChatForm::getLatestTime() const
|
||||||
{
|
{
|
||||||
return getTime(chatWidget->getLatestLine());
|
if (chatLog.getFirstIdx() == chatLog.getNextIdx())
|
||||||
}
|
return QDateTime();
|
||||||
|
|
||||||
QDateTime GenericChatForm::getFirstTime() const
|
return chatLog.at(chatLog.getNextIdx() - 1).getTimestamp();
|
||||||
{
|
|
||||||
return getTime(chatWidget->getFirstLine());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericChatForm::reloadTheme()
|
void GenericChatForm::reloadTheme()
|
||||||
|
|
|
@ -80,7 +80,6 @@ public:
|
||||||
const QDateTime& datetime);
|
const QDateTime& datetime);
|
||||||
static QString resolveToxPk(const ToxPk& pk);
|
static QString resolveToxPk(const ToxPk& pk);
|
||||||
QDateTime getLatestTime() const;
|
QDateTime getLatestTime() const;
|
||||||
QDateTime getFirstTime() const;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void messageInserted();
|
void messageInserted();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user