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
KDevelop
KDevelop
Commits
78ac3920
Commit
78ac3920
authored
Aug 09, 2011
by
Aleix Pol Gonzalez
🐧
Browse files
Drop support for importing SVN projects.
BUG: 278252
parent
0d63923c
Changes
7
Hide whitespace changes
Inline
Side-by-side
providers/kdeprovider/kdeconfig.kcfg
View file @
78ac3920
...
...
@@ -5,9 +5,6 @@
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"
>
<kcfgfile
name=
"kdeproviderpluginconfig"
/>
<group
name=
"KDE"
>
<entry
name=
"svnPrefix"
type=
"String"
>
<default>
svn://anonsvn.kde.org/home/kde
</default>
</entry>
<entry
name=
"gitProtocol"
type=
"String"
>
<default>
git
</default>
</entry>
...
...
providers/kdeprovider/kdeconfig.ui
View file @
78ac3920
...
...
@@ -10,50 +10,43 @@
<height>
300
</height>
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<layout
class=
"QFormLayout"
name=
"formLayout"
>
<property
name=
"fieldGrowthPolicy"
>
<enum>
QFormLayout::AllNonFixedFieldsGrow
</enum>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
KDE SVN root
</string>
<string>
git.kde.org protocol
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
colspan=
"2"
>
<widget
class=
"QLineEdit"
name=
"kcfg_svnPrefix"
/>
</item>
<item
row=
"1"
column=
"0"
colspan=
"2"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
180
</width>
<height>
20
</height>
</size>
</property>
</spacer>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"comboBox"
>
<item>
<property
name=
"text"
>
<string>
git
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
http
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
ssh
</string>
</property>
</item>
</widget>
</item>
<item
row=
"1"
column=
"
2
"
>
<item
row=
"1"
column=
"
1
"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Where do you want to checkout from: ex.
<
em
>
svn
://anon
svn
.kde.org/
home/kde
<
/em
>
</string>
<string>
URL clone protocol ex: git
://anon
git
.kde.org/
kdevelop/
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
...
...
providers/kdeprovider/kdeprojectsmodel.cpp
View file @
78ac3920
...
...
@@ -24,29 +24,6 @@
using
namespace
KDevelop
;
namespace
{
typedef
QPair
<
QString
,
QString
>
QSP
;
const
uint
nOfKDEProjects
=
13
;
Source
kdeProjects
[
nOfKDEProjects
]
=
{
//SVN - kde modules
Source
(
"applications-system"
,
"kdebase"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdebase"
)),
Source
(
""
,
"kdebindings"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdebindings"
)),
Source
(
"applications-education-university"
,
"kdeedu"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdeedu"
)),
Source
(
"applications-games"
,
"kdegames"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdegames"
)),
Source
(
"applications-graphics"
,
"kdegraphics"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdegraphics"
)),
Source
(
""
,
"kdelibs"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdelibs"
)),
Source
(
"applications-multimedia"
,
"kdemultimedia"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdemultimedia"
)),
Source
(
"applications-internet"
,
"kdenetwork"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdenetwork"
)),
Source
(
"kontact"
,
"kdepim"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdepim"
)),
Source
(
""
,
"kdepimlibs"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdepimlibs"
)),
Source
(
"plasma"
,
"kdeplasma-addons"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdeplasma-addons"
)),
Source
(
"applications-development"
,
"kdesdk"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/KDE/kdesdk"
)),
Source
(
""
,
"kdesupport"
,
Source
::
SVN
,
QSP
(
"svn"
,
"trunk/kdesupport"
))
};
}
SourceItem
::
SourceItem
(
const
Source
&
s
)
:
QStandardItem
(
KIcon
(
s
.
icon
),
s
.
name
),
m_s
(
s
)
{
...
...
@@ -59,24 +36,16 @@ QVariant SourceItem::data(int role) const
{
case
KDEProjectsModel
::
VcsLocationRole
:
return
QVariantMap
(
m_s
.
m_urls
);
case
KDEProjectsModel
::
PluginRole
:
return
m_s
.
plugin
();
default:
return
QStandardItem
::
data
(
role
);
}
}
Source
::
Source
(
const
QString
&
anIcon
,
const
QString
&
aName
,
Source
::
VcsType
aType
,
const
QPair
<
QString
,
QString
>&
aUrl
)
:
name
(
aName
),
icon
(
anIcon
)
,
type
(
aType
)
Source
::
Source
(
const
QString
&
anIcon
,
const
QString
&
aName
,
const
QPair
<
QString
,
QString
>&
aUrl
)
:
name
(
aName
),
icon
(
anIcon
)
{
m_urls
[
aUrl
.
first
]
=
aUrl
.
second
;
}
KDEProjectsModel
::
KDEProjectsModel
(
QObject
*
parent
)
:
QStandardItemModel
(
parent
)
{
for
(
uint
i
=
0
;
i
<
nOfKDEProjects
;
++
i
)
{
QStandardItem
*
item
=
new
SourceItem
(
kdeProjects
[
i
]);
appendRow
(
item
);
}
}
{}
providers/kdeprovider/kdeprojectsmodel.h
View file @
78ac3920
...
...
@@ -27,18 +27,14 @@ namespace KDevelop {
struct
Source
{
enum
VcsType
{
Git
,
SVN
};
Source
(
Source
::
VcsType
aType
=
Git
)
:
type
(
aType
)
{}
Source
(
const
QString
&
anIcon
,
const
QString
&
aName
,
Source
::
VcsType
aType
,
const
QPair
<
QString
,
QString
>&
aUrl
);
Source
()
{}
Source
(
const
QString
&
anIcon
,
const
QString
&
aName
,
const
QPair
<
QString
,
QString
>&
aUrl
);
QString
name
;
QString
icon
;
VcsType
type
;
/** urls for protocol */
QVariantMap
m_urls
;
QString
plugin
()
const
{
return
type
==
SVN
?
"kdevsubversion"
:
"kdevgit"
;
}
};
class
SourceItem
:
public
QStandardItem
...
...
providers/kdeprovider/kdeprojectsreader.cpp
View file @
78ac3920
...
...
@@ -59,6 +59,7 @@ void KDEProjectsReader::downloadFinished(QNetworkReply* reply)
{
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
m_errors
+=
reply
->
errorString
();
emit
downloadDone
();
return
;
}
...
...
@@ -72,7 +73,7 @@ void KDEProjectsReader::downloadFinished(QNetworkReply* reply)
QStringRef
name
=
xml
.
name
();
if
(
name
==
"project"
)
m_current
.
push
(
Source
(
Source
::
Git
));
m_current
.
push
(
Source
());
else
if
(
!
m_current
.
isEmpty
())
{
if
(
name
==
"name"
)
...
...
providers/kdeprovider/kdeprojectsreader.h
View file @
78ac3920
...
...
@@ -22,7 +22,6 @@
#include <QNetworkReply>
#include <QStack>
class
KDEProjectsModel
;
class
KDEProjectsReader
:
public
QObject
{
Q_OBJECT
...
...
providers/kdeprovider/kdeproviderwidget.cpp
View file @
78ac3920
...
...
@@ -32,6 +32,7 @@
#include <QStandardItemModel>
#include "kdeprojectsmodel.h"
#include "kdeprojectsreader.h"
#include <QSortFilterProxyModel>
using
namespace
KDevelop
;
...
...
@@ -44,7 +45,6 @@ KDEProviderWidget::KDEProviderWidget(QWidget* parent)
KDEProjectsReader
*
reader
=
new
KDEProjectsReader
(
model
,
model
);
connect
(
reader
,
SIGNAL
(
downloadDone
()),
reader
,
SLOT
(
deleteLater
()));
connect
(
m_projects
,
SIGNAL
(
currentIndexChanged
(
QString
)),
this
,
SIGNAL
(
changed
(
QString
)));
m_projects
->
setModel
(
model
);
layout
()
->
addWidget
(
m_projects
);
...
...
@@ -61,18 +61,19 @@ KDEProviderWidget::KDEProviderWidget(QWidget* parent)
m_dialog
->
addPage
(
page
,
i18n
(
"General"
)
);
connect
(
m_dialog
,
SIGNAL
(
settingsChanged
(
QString
)),
this
,
SLOT
(
loadSettings
()));
QSortFilterProxyModel
*
proxyModel
=
new
QSortFilterProxyModel
(
this
);
proxyModel
->
setSourceModel
(
model
);
proxyModel
->
setDynamicSortFilter
(
true
);
proxyModel
->
sort
(
0
);
proxyModel
->
setSortCaseSensitivity
(
Qt
::
CaseInsensitive
);
m_projects
->
setModel
(
proxyModel
);
}
VcsLocation
extractLocation
(
const
QVariantMap
&
urls
)
{
if
(
urls
.
contains
(
"svn"
))
{
QString
svnPrefix
=
KDEProviderSettings
::
self
()
->
svnPrefix
();
QString
path
=
QString
(
urls
[
"ssh"
].
toString
()).
replace
(
"%PREFIX"
,
svnPrefix
);
return
VcsLocation
(
path
);
}
else
{
QString
gitUrl
=
KDEProviderSettings
::
self
()
->
gitProtocol
();
return
VcsLocation
(
urls
[
"git"
].
toUrl
());
}
QString
gitUrl
=
KDEProviderSettings
::
self
()
->
gitProtocol
();
return
VcsLocation
(
urls
[
gitUrl
].
toUrl
());
}
VcsJob
*
KDEProviderWidget
::
createWorkingCopy
(
const
KUrl
&
destinationDirectory
)
...
...
@@ -84,7 +85,7 @@ VcsJob* KDEProviderWidget::createWorkingCopy(const KUrl& destinationDirectory)
QModelIndex
idx
=
m_projects
->
model
()
->
index
(
pos
,
0
);
Q_ASSERT
(
idx
.
isValid
());
IPlugin
*
plugin
=
ICore
::
self
()
->
pluginController
()
->
pluginForExtension
(
"org.kdevelop.IBasicVersionControl"
,
idx
.
data
(
KDEProjectsModel
::
PluginRole
).
toString
()
);
IPlugin
*
plugin
=
ICore
::
self
()
->
pluginController
()
->
pluginForExtension
(
"org.kdevelop.IBasicVersionControl"
,
"kdevgit"
);
IBasicVersionControl
*
vcIface
=
plugin
->
extension
<
IBasicVersionControl
>
();
VcsJob
*
ret
=
vcIface
->
createWorkingCopy
(
extractLocation
(
idx
.
data
(
KDEProjectsModel
::
VcsLocationRole
).
toMap
()),
destinationDirectory
);
...
...
Write
Preview
Markdown
is supported
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