Commit 5c694b94 authored by David Faure's avatar David Faure

Port away from deprecated API (scripted)

parent 201a01b5
......@@ -301,7 +301,7 @@ namespace Konversation
case TransferStatus:
return transfer->getStatus();
case TransferPointer:
return qVariantFromValue<QObject*>(transfer);
return QVariant::fromValue<QObject*>(transfer);
case TransferProgress:
return transfer->getProgress();
case TransferOfferDate:
......
......@@ -1045,7 +1045,7 @@ bool Channel::shouldShowEvent(ChannelNickPtr channelNick)
if (m_server->isWatchedNick(channelNick->getNickname()))
return true; // nick is on our watched list, so we probably want to see the event
else if (channelNick->timeStamp()+activityThreshold > QDateTime::currentDateTime().toTime_t())
else if (channelNick->timeStamp()+activityThreshold > QDateTime::currentDateTime().toSecsSinceEpoch())
return true; // the nick has spoken within activity threshold
else
return false;
......@@ -2723,7 +2723,7 @@ void Channel::append(const QString& nickname, const QString& message, const QHas
Nick* nick = getNickByName(nickname);
if(nick) {
nick->getChannelNick()->setTimeStamp(QDateTime::currentDateTime().toTime_t());
nick->getChannelNick()->setTimeStamp(QDateTime::currentDateTime().toSecsSinceEpoch());
}
}
......@@ -2737,7 +2737,7 @@ void Channel::appendAction(const QString& nickname, const QString& message, cons
Nick* nick = getNickByName(nickname);
if(nick) {
nick->getChannelNick()->setTimeStamp(QDateTime::currentDateTime().toTime_t());
nick->getChannelNick()->setTimeStamp(QDateTime::currentDateTime().toSecsSinceEpoch());
}
}
......
......@@ -509,7 +509,7 @@ void InputFilter::parseClientCommand(const QString &prefix, const QString &comma
// pong reply, calculate turnaround time
if (replyReason.toLower()==QStringLiteral("ping"))
{
int dateArrived=QDateTime::currentDateTime().toTime_t();
int dateArrived=QDateTime::currentDateTime().toSecsSinceEpoch();
int dateSent=reply.toInt();
int time = dateArrived-dateSent;
QString unit = i18np("second", "seconds", time);
......
......@@ -53,7 +53,7 @@ namespace Konversation
* Converts the ambiguous encoding name to a short encoding name
* Like : iso8859-9 -> iso 8859-9, iso-8859-9 -> iso 8859-9
* If the ambiguous name is invalid, returns QString:null.
* @return a short encoding name or QString::null
* @return a short encoding name or QString()
*/
QString ambiguousNameToShortName( const QString& ambiguousName );
......
......@@ -836,7 +836,7 @@ namespace Konversation
if (request == QLatin1String("PING"))
{
unsigned int timeT = QDateTime::currentDateTime().toTime_t();
unsigned int timeT = QDateTime::currentDateTime().toSecsSinceEpoch();
result.toServer = QString("PRIVMSG %1 :\x01PING %2\x01").arg(recipient).arg(timeT);
result.output = i18n("Sending CTCP-%1 request to %2.", QStringLiteral("PING"), recipient);
}
......
......@@ -587,7 +587,7 @@ int Server::getModesCount()
// set user mode prefixes according to non-standard 005-Reply (see inputfilter.cpp)
void Server::setPrefixes(const QString &modes, const QString& prefixes)
{
// NOTE: serverModes is QString::null, if server did not supply the
// NOTE: serverModes is QString(), if server did not supply the
// modes which relates to the network's nick-prefixes
m_serverNickPrefixModes = modes;
m_serverNickPrefixes = prefixes;
......@@ -2956,7 +2956,7 @@ void Server::updateChannelMode(const QString &updater, const QString &channelNam
{
if (plus)
{
addBan(channelName, QString(QStringLiteral("%1 %2 %3")).arg(parameter).arg(updater).arg(QDateTime::currentDateTime().toTime_t()));
addBan(channelName, QString(QStringLiteral("%1 %2 %3")).arg(parameter).arg(updater).arg(QDateTime::currentDateTime().toSecsSinceEpoch()));
} else {
removeBan(channelName, parameter);
}
......@@ -4146,7 +4146,7 @@ QString Server::awayTime() const
if (m_away)
{
int diff = QDateTime::currentDateTime().toTime_t() - m_awayTime;
int diff = QDateTime::currentDateTime().toSecsSinceEpoch() - m_awayTime;
int num = diff / 3600;
if (num < 10)
......@@ -4174,7 +4174,7 @@ QString Server::awayTime() const
void Server::startAwayTimer()
{
m_awayTime = QDateTime::currentDateTime().toTime_t();
m_awayTime = QDateTime::currentDateTime().toSecsSinceEpoch();
}
void Server::enableIdentifyMsg(bool enabled)
......
......@@ -904,7 +904,7 @@ void MainWindow::notifyAction(int connectionId, const QString& nick)
void MainWindow::setOnlineList(Server* notifyServer,const QStringList& /*list*/, bool /*changed*/)
{
emit nicksNowOnline(notifyServer);
// FIXME if (changed && nicksOnlinePanel) newText(nicksOnlinePanel, QString::null, true);
// FIXME if (changed && nicksOnlinePanel) newText(nicksOnlinePanel, QString(), true);
}
void MainWindow::toggleVisibility()
......
......@@ -318,9 +318,9 @@ bool IRCInput::event(QEvent* e)
void IRCInput::wheelEvent(QWheelEvent* e)
{
if (e->delta() > 0)
if (e->angleDelta().y() > 0)
getHistory(true);
else if (e->delta() < 0)
else if (e->angleDelta().y() < 0)
getHistory(false);
KTextEdit::wheelEvent(e);
......
......@@ -2078,8 +2078,8 @@ void IRCView::wheelEvent(QWheelEvent *ev)
{
if(ev->modifiers()==Qt::ControlModifier)
{
if(ev->delta() < 0) decreaseFontSize();
if(ev->delta() > 0) increaseFontSize();
if(ev->angleDelta().y() < 0) decreaseFontSize();
if(ev->angleDelta().y() > 0) increaseFontSize();
}
QTextBrowser::wheelEvent(ev);
......
......@@ -296,7 +296,7 @@ class IRCView : public QTextBrowser
/// Format the line by adding needed bidi marks
QString formatFinalLine(bool rtl, const QString &lineColor, const QString &label, const QString &nickLine, const QString &nickStar, const QString &text);
/// Returns a formated timestamp if timestamps are enabled else it returns QString::null
/// Returns a formated timestamp if timestamps are enabled else it returns QString()
QString timeStamp(QHash<QString, QString> messageTags, bool rtl);
/// Returns a formated nick string
......
......@@ -218,7 +218,7 @@ void OSDWidget::paintEvent( QPaintEvent *e )
QBitmap mask( e->rect().size() );
QPainter maskPainter( &mask );
p.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing );
p.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform );
p.setClipRect( e->rect() );
// Masking for transparency
......
......@@ -55,7 +55,7 @@ QVariant TopicHistorySortfilterProxyModel::data(const QModelIndex& index, int ro
{
const QModelIndex& sourceIndex = mapToSource(index);
return sourceModel()->data(sourceIndex.sibling(sourceIndex.row(), 2)).toDateTime().toTime_t();
return sourceModel()->data(sourceIndex.sibling(sourceIndex.row(), 2)).toDateTime().toSecsSinceEpoch();
}
return KCategorizedSortFilterProxyModel::data(index, role);
......
......@@ -2405,7 +2405,7 @@ void ViewContainer::appendToFrontmost(const QString& type, const QString& messag
// FIXME: this signal should be sent from the status panel instead, so it
// can be using the correct highlight color, would be more consistent
// anyway!
// FIXME newText(serverView,QString::null,true);
// FIXME newText(serverView,QString(),true);
}
else
m_frontView->appendServerMessage(type, message, messageTags, parseURL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment