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
97c66ce8
Commit
97c66ce8
authored
Feb 09, 2021
by
Vincent Pinon
Browse files
Move Qt-OAuth-Lib to a lib
parent
3095789a
Pipeline
#50359
passed with stage
in 10 minutes and 32 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
97c66ce8
...
...
@@ -65,9 +65,6 @@ add_subdirectory(transitions)
add_subdirectory
(
utils
)
add_subdirectory
(
widgets
)
add_subdirectory
(
xml
)
if
(
Qt5WebEngineWidgets_FOUND
)
add_subdirectory
(
qt-oauth-lib
)
endif
()
## top_SRCS
file
(
GLOB top_SRCS
"*.cpp"
)
if
(
NOT CRASH_AUTO_TEST
)
...
...
@@ -187,7 +184,7 @@ endif()
if
(
Qt5WebEngineWidgets_FOUND
)
message
(
STATUS
"Found Qt5 WebEngineWidgets. You can use your Freesound.org credentials to download files"
)
target_compile_definitions
(
kdenliveLib PRIVATE -DQT5_USE_WEBENGINE
)
target_link_libraries
(
kdenliveLib Qt5::WebEngineWidgets
)
target_link_libraries
(
kdenliveLib Qt5::WebEngineWidgets
qt-oauth-lib
)
else
()
message
(
STATUS
"Qt5 WebEngineWidgets not found. You cannot use your Freesound.org credentials, only preview files can be downloaded from the Online Resources Widget"
)
endif
()
...
...
src/lib/external/CMakeLists.txt
View file @
97c66ce8
add_subdirectory
(
kiss_fft
)
add_subdirectory
(
media_ctrl
)
set
(
kdenlive_SRCS
${
kdenlive_SRCS
}
PARENT_SCOPE
)
add_subdirectory
(
qt-oauth-lib
)
src/lib/external/qt-oauth-lib/CMakeLists.txt
0 → 100644
View file @
97c66ce8
# Create a static library from oauth2
if
(
Qt5WebEngineWidgets_FOUND
)
ki18n_wrap_ui
(
login_UI logindialog_ui.ui
)
add_library
(
qt-oauth-lib STATIC oauth2.cpp logindialog.cpp
${
login_UI
}
)
target_link_libraries
(
qt-oauth-lib Qt5::WebEngineWidgets KF5::I18n KF5::ConfigGui
)
target_compile_definitions
(
qt-oauth-lib PRIVATE -DQT5_USE_WEBENGINE
)
endif
()
src/qt-oauth-lib/logindialog.cpp
→
src/
lib/external/
qt-oauth-lib/logindialog.cpp
View file @
97c66ce8
...
...
@@ -37,7 +37,6 @@
#include "logindialog.h"
#include "ui_logindialog_ui.h"
#include "kdenlive_debug.h"
#include <QWebEngineView>
LoginDialog
::
LoginDialog
(
QWidget
*
parent
)
...
...
@@ -55,7 +54,6 @@ LoginDialog::LoginDialog(QWidget *parent)
// m_ui->textBrowser
connect
(
m_ui
->
webView
,
&
QWebEngineView
::
urlChanged
,
this
,
&
LoginDialog
::
urlChanged
);
connect
(
m_ui
->
webView
,
&
QWebEngineView
::
loadFinished
,
this
,
[
&
](){
qDebug
()
<<
"LoginDialog: loadFinished"
;
this
->
setEnabled
(
true
);
});
}
...
...
@@ -91,7 +89,6 @@ void LoginDialog::slotRejected()
*/
void
LoginDialog
::
urlChanged
(
const
QUrl
&
url
)
{
// qCDebug(KDENLIVE_LOG) << "URL =" << url;
const
QString
str
=
url
.
query
(
QUrl
::
FullyDecoded
);
const
int
posCode
=
str
.
indexOf
(
QLatin1String
(
"code="
));
const
int
posErr
=
str
.
indexOf
(
QLatin1String
(
"error="
));
...
...
src/qt-oauth-lib/logindialog.h
→
src/
lib/external/
qt-oauth-lib/logindialog.h
View file @
97c66ce8
File moved
src/
ui
/logindialog_ui.ui
→
src/
lib/external/qt-oauth-lib
/logindialog_ui.ui
View file @
97c66ce8
File moved
src/qt-oauth-lib/oauth2.cpp
→
src/
lib/external/
qt-oauth-lib/oauth2.cpp
View file @
97c66ce8
...
...
@@ -36,7 +36,6 @@
*********************************************************************************************************/
#include "oauth2.h"
#include "kdenlive_debug.h"
#include "logindialog.h"
#include <KConfigGroup>
...
...
@@ -44,6 +43,7 @@
#include <QJsonParseError>
#include <QUrl>
#include <QUrlQuery>
#include <QDebug>
OAuth2
::
OAuth2
(
QWidget
*
parent
)
...
...
@@ -132,7 +132,6 @@ QString OAuth2::loginUrl()
{
QString
str
=
QStringLiteral
(
"%1?client_id=%2&redirect_uri=%3&response_type=%4"
).
arg
(
m_strEndPoint
,
m_strClientID
,
m_strRedirectURI
,
m_strResponseType
);
// qCDebug(KDENLIVE_LOG) << "Login URL" << str;
return
str
;
}
...
...
@@ -161,7 +160,7 @@ void OAuth2::obtainAccessToken()
*/
void
OAuth2
::
SlotAccessDenied
()
{
q
C
Debug
(
KDENLIVE_LOG
)
<<
"access denied"
;
qDebug
()
<<
"access denied"
;
emit
accessDenied
();
m_pLoginDialog
=
nullptr
;
}
...
...
@@ -236,7 +235,7 @@ void OAuth2::serviceRequestFinished(QNetworkReply *reply)
QJsonParseError
jsonError
;
QJsonDocument
doc
=
QJsonDocument
::
fromJson
(
sReply
,
&
jsonError
);
if
(
jsonError
.
error
!=
QJsonParseError
::
NoError
)
{
q
C
Debug
(
KDENLIVE_LOG
)
<<
"OAuth2::serviceRequestFinished jsonError.error: "
<<
jsonError
.
errorString
();
qDebug
()
<<
"OAuth2::serviceRequestFinished jsonError.error: "
<<
jsonError
.
errorString
();
ForgetAccessToken
();
emit
accessTokenReceived
(
QString
());
// notifies ResourceWidget::slotAccessTokenReceived - empty string in access token indicates error
...
...
@@ -259,7 +258,7 @@ void OAuth2::serviceRequestFinished(QNetworkReply *reply)
if
(
map
.
contains
(
QStringLiteral
(
"error"
)))
{
m_bAccessTokenRec
=
false
;
sErrorText
=
map
.
value
(
QStringLiteral
(
"error"
)).
toString
();
q
C
Debug
(
KDENLIVE_LOG
)
<<
"OAuth2::serviceRequestFinished map error: "
<<
sErrorText
;
qDebug
()
<<
"OAuth2::serviceRequestFinished map error: "
<<
sErrorText
;
ForgetAccessToken
();
emit
accessTokenReceived
(
QString
());
// notifies ResourceWidget::slotAccessTokenReceived - empty string in access token indicates error
}
...
...
src/qt-oauth-lib/oauth2.h
→
src/
lib/external/
qt-oauth-lib/oauth2.h
View file @
97c66ce8
...
...
@@ -34,8 +34,8 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*********************************************************************************************************/
#ifndef OAUTH
2
_H
#define OAUTH
2
_H
#ifndef
QT
OAUTH
LIB
_H
#define
QT
OAUTH
LIB
_H
#include <QNetworkReply>
#include <QObject>
...
...
src/qt-oauth-lib/CMakeLists.txt
deleted
100644 → 0
View file @
3095789a
set
(
kdenlive_SRCS
${
kdenlive_SRCS
}
qt-oauth-lib/logindialog.cpp
qt-oauth-lib/oauth2.cpp
PARENT_SCOPE
)
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