Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
ed9daa20
Commit
ed9daa20
authored
Jan 09, 2021
by
Julius Künzel
Committed by
Jean-Baptiste Mardelle
Jan 10, 2021
Browse files
Fix broken Freesound login and import
Signed-off-by:
Julius Künzel
<
jk.kdedev@smartlab.uber.space
>
parent
3cfaf1a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/qt-oauth-lib/logindialog.cpp
View file @
ed9daa20
...
...
@@ -83,15 +83,15 @@ void LoginDialog::slotRejected()
void
LoginDialog
::
urlChanged
(
const
QUrl
&
url
)
{
// qCDebug(KDENLIVE_LOG) << "URL =" << url;
const
QString
str
=
url
.
toString
(
);
const
int
posCode
=
str
.
indexOf
(
QLatin1String
(
"
&
code="
));
const
int
posErr
=
str
.
indexOf
(
QLatin1String
(
"
&
error="
));
const
QString
str
=
url
.
query
(
QUrl
::
FullyDecoded
);
const
int
posCode
=
str
.
indexOf
(
QLatin1String
(
"code="
));
const
int
posErr
=
str
.
indexOf
(
QLatin1String
(
"error="
));
if
(
posCode
!=
-
1
)
{
m_strAuthCode
=
str
.
mid
(
posCode
+
6
);
m_strAuthCode
=
str
.
mid
(
posCode
+
5
);
emit
authCodeObtained
();
QDialog
::
accept
();
}
else
if
(
posErr
!=
-
1
)
{
QString
sError
=
str
.
mid
(
posErr
+
7
);
QString
sError
=
str
.
mid
(
posErr
+
6
);
if
(
sError
==
QLatin1String
(
"access_denied"
))
{
emit
accessDenied
();
}
...
...
src/utils/resourcewidget.cpp
View file @
ed9daa20
...
...
@@ -18,9 +18,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
/*
*
*/
#include "resourcewidget.h"
#include "archiveorg.h"
#include "freesound.h"
...
...
@@ -758,7 +755,7 @@ void ResourceWidget::slotAccessTokenReceived(const QString &sAccessToken)
QUrl
srcUrl
(
m_currentInfo
.
itemDownload
);
request
.
setUrl
(
srcUrl
);
// Download url of a freesound file
// eg https://www.freesound.org/apiv2/sounds/39206/download/
request
.
setRawHeader
(
QByteArray
(
"Authorization"
),
QByteArray
(
"Bearer"
).
append
(
sAccessToken
.
toUtf8
()));
request
.
setRawHeader
(
QByteArray
(
"Authorization"
),
QByteArray
(
"Bearer
"
).
append
(
sAccessToken
.
toUtf8
()));
//Space after "Bearer" is necessary
m_meta
=
QString
();
m_desc
=
QStringLiteral
(
"<br><b>"
)
+
i18n
(
"Starting File Download"
)
+
QStringLiteral
(
"</b><br>"
);
...
...
@@ -792,6 +789,7 @@ QString ResourceWidget::GetSaveFileNameAndPathS(const QString &path, const QStri
{
return
saveUrlstring
;
}
if
(
QFile
::
exists
(
saveUrlstring
))
{
int
ret
=
QMessageBox
::
warning
(
this
,
i18n
(
"File Exists"
),
i18n
(
"Do you want to overwrite the existing file?"
),
QMessageBox
::
Yes
|
QMessageBox
::
No
,
QMessageBox
::
No
);
...
...
@@ -835,7 +833,7 @@ void ResourceWidget::DownloadRequestFinished(QNetworkReply *reply)
file
.
close
();
KMessageBox
::
information
(
this
,
i18n
(
"Resource saved to %1"
,
m_saveLocation
),
i18n
(
"Data Imported"
));
emit
addClip
(
QUrl
(
m_saveLocation
),
QString
());
// MainWindow::slotDownloadResources() links this signal to MainWindow::slotAddProjectClip
emit
addClip
(
QUrl
::
fromLocalFile
(
m_saveLocation
),
QString
());
// MainWindow::slotDownloadResources() links this signal to MainWindow::slotAddProjectClip
m_desc
.
append
(
QStringLiteral
(
"<br>"
)
+
i18n
(
"Saved file to"
)
+
QStringLiteral
(
"<br>"
));
m_desc
.
append
(
m_saveLocation
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment