Commit d4352167 authored by David Faure's avatar David Faure

add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + fix compilation, should fix 4 or 5 bugs.

parent 1e22c7dd
......@@ -39,6 +39,7 @@ set_package_properties(KF5People PROPERTIES DESCRIPTION "KDE Contacts aggregatio
if (KF5People_FOUND)
add_definitions(-DHAVE_KPEOPLE)
endif ()
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_subdirectory(image-sharer)
add_subdirectory(lib)
......
......@@ -63,7 +63,7 @@ void AdiumxtraProtocolHandler::install()
QTemporaryFile *tmpFile = new QTemporaryFile();
if (tmpFile->open()) {
KIO::Job* getJob = KIO::file_copy(url.toDisplayString(), QUrl(tmpFile->fileName()), -1,
KIO::Job* getJob = KIO::file_copy(url, QUrl::fromLocalFile(tmpFile->fileName()), -1,
KIO::Overwrite | KIO::HideProgressInfo);
if (getJob->exec()) {
qWarning() << "Download failed";
......
......@@ -1205,7 +1205,7 @@ void ChatWindow::startFileTransfer(const Tp::AccountPtr& account, const Tp::Cont
void ChatWindow::offerDocumentToContact(const Tp::AccountPtr& account, const Tp::ContactPtr& targetContact)
{
const QUrl url = QFileDialog::getOpenFileName();
const QUrl url = QUrl::fromLocalFile(QFileDialog::getOpenFileName());
if ( ! url.isEmpty() ) {
KTp::Actions::startCollaborativeEditing(account, targetContact, QList<QUrl>() << url, true);
}
......@@ -1213,7 +1213,7 @@ void ChatWindow::offerDocumentToContact(const Tp::AccountPtr& account, const Tp:
void ChatWindow::offerDocumentToChatroom(const Tp::AccountPtr& account, const QString& roomName)
{
const QUrl url = QFileDialog::getOpenFileName();
const QUrl url = QUrl::fromLocalFile(QFileDialog::getOpenFileName());
if ( ! url.isEmpty() ) {
KTp::Actions::startCollaborativeEditing(account, roomName, QList<QUrl>() << url, true);
}
......
......@@ -48,7 +48,7 @@ void ImageBinSharer::parseResponse(const QByteArray& responseData)
QByteArray ImageBinSharer::postBody(const QByteArray& imageData)
{
m_form.addFile(QLatin1String("file"), m_contentPath, imageData);
m_form.addFile(QLatin1String("file"), QUrl::fromLocalFile(m_contentPath), imageData);
m_form.finish();
return m_form.formData();
}
......@@ -46,7 +46,7 @@ QUrl ImgurSharer::url() const
QByteArray ImgurSharer::postBody(const QByteArray &imageData)
{
// Create the request body
m_form.addFile(QLatin1String("image"), m_contentPath, imageData);
m_form.addFile(QLatin1String("image"), QUrl::fromLocalFile(m_contentPath), imageData);
m_form.finish();
return m_form.formData();
}
......
......@@ -36,7 +36,7 @@ void SimplestImageHostingSharer::parseResponse(const QByteArray& responseData)
QString responseString = QLatin1String(responseData);
QRegExp exp(QLatin1String("800\n(http://.+)\n"));
if ( exp.indexIn(responseString) != -1) {
m_imageUrl = responseString.replace(QLatin1String("800"), QLatin1String("")).replace(QLatin1String("\n"), QLatin1String(""));
m_imageUrl = QUrl(responseString.remove(QLatin1String("800")).remove(QLatin1String("\n")));
} else {
m_hasError = true;
m_errorMessage = responseString;
......@@ -45,7 +45,7 @@ void SimplestImageHostingSharer::parseResponse(const QByteArray& responseData)
QByteArray SimplestImageHostingSharer::postBody(const QByteArray& imageData)
{
m_form.addFile(QLatin1String("fileName"), m_contentPath, imageData);
m_form.addFile(QLatin1String("fileName"), QUrl::fromLocalFile(m_contentPath), imageData);
m_form.finish();
return m_form.formData();
......
......@@ -1417,14 +1417,14 @@ void ChatWidget::initChatArea()
info.setDestinationDisplayName(otherContact->alias());
info.setDestinationName(otherContact->id());
info.setChatName(otherContact->alias());
info.setIncomingIconPath(otherContact->avatarData().fileName);
info.setIncomingIconPath(QUrl::fromLocalFile(otherContact->avatarData().fileName));
d->ui.contactsView->hide();
}
info.setSourceName(d->channel->textChannel()->connection()->protocolName());
//set up anything related to 'self'
info.setOutgoingIconPath(d->channel->textChannel()->groupSelfContact()->avatarData().fileName);
info.setOutgoingIconPath(QUrl::fromLocalFile(d->channel->textChannel()->groupSelfContact()->avatarData().fileName));
//set the message time
if (!d->channel->messageQueue().isEmpty()) {
......
......@@ -61,7 +61,7 @@ void EntityView::rowsInserted(const QModelIndex &parent, int start, int end)
const QString selectedPersonaId = QCoreApplication::arguments().at(0);
for (int i = start; i <= end; i++) {
const QModelIndex index = model()->index(i, 0, parent);
if (index.data(KTp::PersonIdRole).toUrl() == selectedPersonaId) {
if (index.data(KTp::PersonIdRole).toUrl().toString() == selectedPersonaId) {
selectedIndex = index;
break;
}
......
......@@ -126,7 +126,7 @@ void MessageView::onEventsLoaded(KTp::PendingLoggerOperation *po)
headerInfo.setChatName(m_contact.isNull() ? m_entity.alias() : m_contact->alias());
headerInfo.setGroupChat(m_entity.entityType() == Tp::HandleTypeRoom);
headerInfo.setSourceName(m_account->displayName());
headerInfo.setIncomingIconPath(m_contact.isNull() ? QString() : m_contact->avatarData().fileName);
headerInfo.setIncomingIconPath(m_contact.isNull() ? QUrl() : QUrl::fromLocalFile(m_contact->avatarData().fileName));
headerInfo.setService(m_account->serviceName());
// check iconPath docs for minus sign in -KIconLoader::SizeMedium
headerInfo.setServiceIconPath(KIconLoader::global()->iconPath(m_account->iconName(), -KIconLoader::SizeMedium));
......
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