Commit 72bd4505 authored by Adrien Béraud's avatar Adrien Béraud

Revert "fix: name compatibility with lrc"

This reverts commit d7e41445.

Reason for revert: breaks the release build

Change-Id: Ieee7165a7c3197c39d596ac4d9fb310eacb2178d
parent d7e41445
......@@ -244,14 +244,14 @@ CallWidget::setupOutOfCallIM()
connect(displayAuthor, &QAction::triggered, lamdba);
connect(displayDate, &QAction::triggered, lamdba);
connect(&::media::RecordingModel::instance(),
SIGNAL(newTextMessage(::media::TextRecording*, ContactMethod*)),
connect(&::Media::RecordingModel::instance(),
SIGNAL(newTextMessage(::Media::TextRecording*, ContactMethod*)),
this,
SLOT(onIncomingMessage(::media::TextRecording*, ContactMethod*)));
SLOT(onIncomingMessage(::Media::TextRecording*, ContactMethod*)));
}
void
CallWidget::onIncomingMessage(::media::TextRecording* t, ContactMethod* cm)
CallWidget::onIncomingMessage(::Media::TextRecording* t, ContactMethod* cm)
{
Q_UNUSED(cm)
......@@ -261,7 +261,7 @@ CallWidget::onIncomingMessage(::media::TextRecording* t, ContactMethod* cm)
GlobalSystemTray::instance()
.showMessage("Ring",
QString(tr("Message incoming from %1")).arg(
idx.data((int)media::TextRecording::Role::AuthorDisplayname).toString()));
idx.data((int)Media::TextRecording::Role::AuthorDisplayname).toString()));
QApplication::alert(this, 5000);
}
}
......@@ -828,7 +828,7 @@ CallWidget::showIMOutOfCall(const QModelIndex& nodeIdx)
ui->imMessageEdit->setFocus();
disconnect(imClickedConnection_);
imClickedConnection_ = connect(ui->listMessageView, &QListView::clicked, [this](const QModelIndex& index) {
auto urlList = index.data(static_cast<int>(media::TextRecording::Role::LinkList)).value<QList<QUrl>>();
auto urlList = index.data(static_cast<int>(Media::TextRecording::Role::LinkList)).value<QList<QUrl>>();
if (urlList.size() == 1)
QDesktopServices::openUrl(urlList.at(0));
else if (urlList.size()) {
......@@ -883,9 +883,9 @@ void CallWidget::on_contactMethodComboBox_currentIndexChanged(int index)
if (imConnection_)
disconnect(imConnection_);
imConnection_ = connect(txtRecording,
SIGNAL(messageInserted(QMap<QString,QString>,ContactMethod*,media::Media::Direction)),
SIGNAL(messageInserted(QMap<QString,QString>,ContactMethod*,Media::Media::Direction)),
this,
SLOT(slotAccountMessageReceived(QMap<QString,QString>,ContactMethod*,media::Media::Direction)));
SLOT(slotAccountMessageReceived(QMap<QString,QString>,ContactMethod*,Media::Media::Direction)));
auto messagesPresent = txtRecording->instantMessagingModel()->rowCount() > 0;
if (messagesPresent) {
ui->listMessageView->scrollToBottom();
......@@ -911,7 +911,7 @@ void CallWidget::on_contactMethodComboBox_currentIndexChanged(int index)
void
CallWidget::slotAccountMessageReceived(const QMap<QString,QString> message,
ContactMethod* cm,
media::Media::Direction dir)
Media::Media::Direction dir)
{
Q_UNUSED(message)
Q_UNUSED(dir)
......
......@@ -86,8 +86,8 @@ private slots:
void callStateChanged(Call* call, Call::State previousState);
void smartListCurrentChanged(const QModelIndex &currentIdx, const QModelIndex &previousIdx);
void contactReqListCurrentChanged(const QModelIndex &currentIdx, const QModelIndex &previousIdx);
void slotAccountMessageReceived(const QMap<QString,QString> message,ContactMethod* cm, media::Media::Direction dir);
void onIncomingMessage(::media::TextRecording* t, ContactMethod* cm);
void slotAccountMessageReceived(const QMap<QString,QString> message,ContactMethod* cm,Media::Media::Direction dir);
void onIncomingMessage(::Media::TextRecording* t, ContactMethod* cm);
void callChangedSlot();
void contactLineEdit_registeredNameFound(Account *account, NameDirectory::LookupStatus status, const QString& address, const QString& name);
void searchBtnClicked();
......
......@@ -136,16 +136,16 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
ui->videoView->setIsFullPreview(true);
auto recordPath = media::RecordingModel::instance().recordPath();
auto recordPath = Media::RecordingModel::instance().recordPath();
if (recordPath.isEmpty()) {
recordPath = QDir::toNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
media::RecordingModel::instance().setRecordPath(recordPath);
Media::RecordingModel::instance().setRecordPath(recordPath);
}
ui->recordPath->setText(media::RecordingModel::instance().recordPath());
ui->recordPath->setText(Media::RecordingModel::instance().recordPath());
ui->alwaysRecordCheckBox->setChecked(media::RecordingModel::instance().isAlwaysRecording());
ui->alwaysRecordCheckBox->setChecked(Media::RecordingModel::instance().isAlwaysRecording());
connect(ui->alwaysRecordCheckBox, &QCheckBox::clicked, [](bool checked){
media::RecordingModel::instance().setAlwaysRecording(checked);
Media::RecordingModel::instance().setAlwaysRecording(checked);
});
connect(ui->generalTabButton, &QPushButton::toggled, [=] (bool toggled) {
......@@ -387,11 +387,11 @@ void
ConfigurationWidget::on_recordPath_clicked()
{
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose Directory"),
media::RecordingModel::instance().recordPath(),
Media::RecordingModel::instance().recordPath(),
QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks);
if (not dir.isEmpty()) {
media::RecordingModel::instance().setRecordPath(dir);
Media::RecordingModel::instance().setRecordPath(dir);
ui->recordPath->setText(dir);
}
}
......
......@@ -41,11 +41,11 @@ ImDelegate::formatMsg(const QModelIndex& index, QString& msg) const
QStringList meta;
if (settings.value(SettingsKey::imShowAuthor).toBool()) {
meta << index.data(
static_cast<int>(media::TextRecording::Role::AuthorDisplayname)).toString();
static_cast<int>(Media::TextRecording::Role::AuthorDisplayname)).toString();
}
if (settings.value(SettingsKey::imShowDate).toBool()) {
auto timeStamp = index.data(
static_cast<int>(media::TextRecording::Role::Timestamp)).value<uint>();
static_cast<int>(Media::TextRecording::Role::Timestamp)).value<uint>();
auto date = QDateTime::fromTime_t(timeStamp);
auto now = QDateTime::currentDateTime();
if (now.date() == date.date())
......@@ -69,12 +69,12 @@ ImDelegate::paint(QPainter* painter,
painter->setFont(fontMsg_);
if (index.isValid()) {
auto msg = index.data(static_cast<int>(media::TextRecording::Role::FormattedHtml)).toString();
auto msg = index.data(static_cast<int>(Media::TextRecording::Role::FormattedHtml)).toString();
opt.text.clear();
QStyle* style = opt.widget ? opt.widget->style() : QApplication::style();
auto dir = index.data(static_cast<int>(media::TextRecording::Role::Direction))
.value<media::Media::Direction>() == media::Media::Direction::IN
auto dir = index.data(static_cast<int>(Media::TextRecording::Role::Direction))
.value<Media::Media::Direction>() == Media::Media::Direction::IN
? Qt::AlignLeft : Qt::AlignRight;
formatMsg(index, msg);
......@@ -156,11 +156,11 @@ ImDelegate::sizeHint(const QStyleOptionViewItem& option,
QStyleOptionViewItem opt = option;
opt.font = fontMsg_;
QString msg = index.data(static_cast<int>(media::TextRecording::Role::FormattedHtml)).toString();
QString msg = index.data(static_cast<int>(Media::TextRecording::Role::FormattedHtml)).toString();
auto dir = index.data(
static_cast<int>(media::TextRecording::Role::Direction))
.value<media::Media::Direction>() == media::Media::Direction::IN
static_cast<int>(Media::TextRecording::Role::Direction))
.value<Media::Media::Direction>() == Media::Media::Direction::IN
? Qt::AlignLeft : Qt::AlignRight;
formatMsg(index, msg);
......
......@@ -77,13 +77,13 @@ InstantMessagingWidget::setMediaText(Call *call)
ui->listMessageView->disconnect();
ui->messageEdit->disconnect();
if (call != nullptr) {
connect(call, SIGNAL(mediaAdded(media::Media*)),
this, SLOT(mediaAdd(media::Media*)));
media::Text *textMedia = nullptr;
if (call->hasMedia(media::Media::Type::TEXT, media::Media::Direction::OUT)) {
textMedia = call->firstMedia<media::Text>(media::Media::Direction::OUT);
connect(call, SIGNAL(mediaAdded(Media::Media*)),
this, SLOT(mediaAdd(Media::Media*)));
Media::Text *textMedia = nullptr;
if (call->hasMedia(Media::Media::Type::TEXT, Media::Media::Direction::OUT)) {
textMedia = call->firstMedia<Media::Text>(Media::Media::Direction::OUT);
} else {
textMedia = call->addOutgoingMedia<media::Text>();
textMedia = call->addOutgoingMedia<Media::Text>();
}
if (textMedia) {
ui->listMessageView->setModel(
......@@ -105,23 +105,23 @@ InstantMessagingWidget::setMediaText(Call *call)
}
void
InstantMessagingWidget::mediaAdd(media::Media *media)
InstantMessagingWidget::mediaAdd(Media::Media *media)
{
switch(media->type()) {
case media::Media::Type::AUDIO:
case Media::Media::Type::AUDIO:
break;
case media::Media::Type::VIDEO:
case Media::Media::Type::VIDEO:
break;
case media::Media::Type::TEXT:
if (media->direction() == media::Text::Direction::IN) {
connect(static_cast<media::Text*>(media),
case Media::Media::Type::TEXT:
if (media->direction() == Media::Text::Direction::IN) {
connect(static_cast<Media::Text*>(media),
SIGNAL(messageReceived(QMap<QString,QString>)),
this,
SLOT(onMsgReceived(QMap<QString,QString>)));
this->show();
}
break;
case media::Media::Type::FILE:
case Media::Media::Type::FILE:
break;
default:
break;
......
......@@ -49,7 +49,7 @@ private slots:
void on_sendButton_clicked();
private slots:
void mediaAdd(media::Media *media);
void mediaAdd(Media::Media *media);
void onMsgReceived(const QMap<QString, QString>& message);
private:
......
......@@ -87,7 +87,7 @@ SelectAreaDialog::mouseReleaseEvent(QMouseEvent* event)
QApplication::restoreOverrideCursor();
releaseMouse();
if (auto call = CallModel::instance().selectedCall()) {
if (auto outVideo = call->firstMedia<media::Video>(media::Media::Direction::OUT)) {
if (auto outVideo = call->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
QRect realRect = rubberBand_->geometry();
#ifdef Q_OS_WIN
if (QGuiApplication::primaryScreen()->devicePixelRatio() > 1.0) {
......
......@@ -175,7 +175,7 @@ VideoView::dropEvent(QDropEvent* event)
{
auto urls = event->mimeData()->urls();
if (auto call = CallModel::instance().selectedCall()) {
if (auto outVideo = call->firstMedia<media::Video>(media::Media::Direction::OUT)) {
if (auto outVideo = call->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
outVideo->sourceModel()->setFile(urls.at(0));
}
}
......@@ -204,11 +204,11 @@ VideoView::showContextMenu(const QPoint& pos)
QPoint globalPos = this->mapToGlobal(pos);
QMenu menu;
media::Video* outVideo = nullptr;
Media::Video* outVideo = nullptr;
int activeIndex = -1;
if (auto call = CallModel::instance().selectedCall()) {
outVideo = call->firstMedia<media::Video>(media::Media::Direction::OUT);
outVideo = call->firstMedia<Media::Video>(Media::Media::Direction::OUT);
if (outVideo)
activeIndex = outVideo->sourceModel()->activeIndex();
}
......
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