Skip to content

Commit

Permalink
Remove space
Browse files Browse the repository at this point in the history
  • Loading branch information
c0re100 committed Sep 7, 2024
1 parent 5371201 commit 6bc6f39
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/history/history_inner_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3410,7 +3410,7 @@ TextForMimeData HistoryInner::getSelectedText() const {
const auto i = texts.emplace(item->position(), Part{
.name = item->author()->name(),
.time = QString(", [%1]\n").arg(
QLocale().toString(ItemDateTime(item), GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat))),
QLocale().toString(ItemDateTime(item), GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat))),
.unwrapped = std::move(unwrapped),
}).first;
fullSize += i->second.name.size()
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/history/history_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ void HistoryItem::setCommentsItemId(FullMsgId id) {

QString GenerateServiceTime(TimeId date) {
if (date > 0) {
return QString(" (%1)").arg(base::unixtime::parse(date).toString(GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat)));
return QString(" (%1)").arg(base::unixtime::parse(date).toString(GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat)));
}
return QString();
}
Expand Down Expand Up @@ -5842,7 +5842,7 @@ PreparedServiceText HistoryItem::prepareCallScheduledText(
};
const auto time = QLocale().toString(
scheduled.time(),
GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat));
GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat));
const auto prepareGeneric = [&] {
prepareWithDate(tr::lng_group_call_starts_date(
tr::now,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void BottomInfo::layoutDateText() {
const auto prefix = !author.isEmpty() ? u", "_q : QString();
const auto date = edited + QLocale().toString(
_data.date.time(),
GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat)) + _data.msgId;
GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat)) + _data.msgId;
const auto afterAuthor = prefix + date;
const auto afterAuthorWidth = st::msgDateFont->width(afterAuthor);
const auto authorWidth = st::msgDateFont->width(author);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ TextForMimeData ListWidget::getSelectedText() const {
not_null<HistoryItem*> item,
TextForMimeData &&unwrapped) {
auto time = QString(", [%1]\n").arg(
QLocale().toString(ItemDateTime(item), GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat)));
QLocale().toString(ItemDateTime(item), GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat)));
auto part = TextForMimeData();
auto size = item->author()->name().size()
+ time.size()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Call::Call(
_text = Data::MediaCall::Text(item, _reason, _video);
_status = QLocale().toString(
parent->dateTime().time(),
GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat));
GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat));
if (_duration) {
_status = tr::lng_call_duration_info(
tr::now,
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/media/player/media_player_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void Widget::handleSongChange() {
const auto date = [item] {
const auto parsed = ItemDateTime(item);
const auto date = parsed.date();
const auto time = QLocale().toString(parsed.time(), GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat));
const auto time = QLocale().toString(parsed.time(), GetEnhancedBool("show_seconds") ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat));
const auto today = QDateTime::currentDateTime().date();
if (date == today) {
return tr::lng_player_message_today(
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/ui/text/format_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ QString FormatDialogsDate(const QDateTime &lastTime, bool showSeconds) {

if ((lastDate == nowDate)
|| (std::abs(lastTime.secsTo(now)) < kRecentlyInSeconds)) {
return QLocale().toString(lastTime.time(), showSeconds ? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t") : QLocale::system().timeFormat(QLocale::ShortFormat));
return QLocale().toString(lastTime.time(), showSeconds ? QLocale::system().timeFormat(QLocale::LongFormat).remove("t") : QLocale::system().timeFormat(QLocale::ShortFormat));
} else if (std::abs(lastDate.daysTo(nowDate)) < 7) {
return langDayOfWeek(lastDate);
} else {
Expand Down

0 comments on commit 6bc6f39

Please sign in to comment.