Skip to content

Commit 53d3ea9

Browse files
borysiastyNathanW2
authored andcommitted
Code cleanups
1 parent 81f0319 commit 53d3ea9

11 files changed

+212
-560
lines changed
Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* \class QgsPluginManagerInterface
3-
* \brief Abstract base class to make QgsPluginManager available to plugins.
3+
* \brief Abstract base class to make QgsPluginManager available to pyplugin_installer.
44
*/
55
class QgsPluginManagerInterface : QObject
66
{
@@ -16,35 +16,24 @@ class QgsPluginManagerInterface : QObject
1616
//! Virtual destructor
1717
~QgsPluginManagerInterface();
1818

19-
//! remove metadata of all python plugins from the registry (c++ plugins stay)
19+
//! remove python plugins from the metadata registry (c++ plugins stay)
2020
virtual void clearPythonPluginMetadata() = 0;
2121

2222
//! add a single plugin to the metadata registry
23-
virtual void addPluginMetadata( QMap<QString,QString> metadata ) = 0;
23+
virtual void addPluginMetadata( QMap<QString, QString> metadata ) = 0;
2424

25-
//! refresh listView model and textView content
25+
//! refresh plugin list model (and metadata browser content if necessary)
2626
virtual void reloadModel() = 0;
2727

28-
//! get given plugin metadata
28+
//! return given plugin metadata
2929
virtual QMap<QString, QString> * pluginMetadata( QString key ) = 0;
3030

3131
//! clear the repository listWidget
3232
virtual void clearRepositoryList() = 0;
3333

3434
//! add repository to the repository listWidget
35-
virtual void addToRepositoryList( QMap<QString,QString> repository ) = 0;
35+
virtual void addToRepositoryList( QMap<QString, QString> repository ) = 0;
3636

37-
signals:
38-
39-
//! emitted when the Python Plugin Installer should show the fetching repositories window
40-
void fetchingStillInProgress( );
41-
42-
public slots:
43-
44-
//! show the Plugin Manager window when remote repositories are fetched.
45-
//! Display a progress dialog when fetching.
46-
virtual void showPluginManagerWhenReady( ) = 0;
47-
48-
//! promptly show the Plugin Manager window and optionally open tab tabIndex:
37+
//! show the Plugin Manager window and optionally open tab tabIndex
4938
virtual void showPluginManager( int tabIndex = -1 ) = 0;
5039
};

src/app/pluginmanager/metadata

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
PLUGIN METADATA TAGS
22
=======================================================
3-
id the key, usually library base name
4-
name
3+
id the key,library base name
4+
name human readable plugin name
55
description
6-
icon path to installed or available icon
7-
category will be removed?
8-
tags comma separated, spaces allowed
9-
changelog may be multiline
6+
icon path to installed or available icon
7+
category isn't it depreciated?
8+
tags comma separated, spaces allowed
9+
changelog may be multiline
1010
author_name
1111
author_email
12-
homepage url
13-
tracker url
14-
code_repository url
12+
homepage url
13+
tracker url
14+
code_repository url
1515
version_installed
16-
library cpp: path to the installed library | Python: module name
17-
pythonic is plugin pythonic or cpp?
18-
readonly is core plugin?
19-
status not installed | installed | upgradeable | orphan | new | newer *
20-
error NULL | broken | incompatible | dependent
16+
library absolute path to the installed library / module
17+
pythonic true | false (is plugin pythonic or cpp?)
18+
readonly true | false (is core plugin?)
19+
installed true | false
20+
available true | false
21+
status not installed | new | upgradeable | orphan | newer *
22+
error NULL | broken | incompatible | dependent
2123
error_details
22-
experimental choosen version status
24+
experimental choosen version status
2325
version_available
24-
zip_repository the remote repository id
26+
zip_repository the remote repository id
2527
download_url
26-
filename the zip file name
27-
downloads number of dowloads
28+
filename the zip file name to be unpacked
29+
downloads number of dowloads
2830
average_vote
29-
rating_votes number of votes
31+
rating_votes number of votes
32+
33+
* status is only obligatory for Pythin plugins and it must match all the tags:
34+
available, installed. version_available, version_installed.
35+
orphan = installed and not available to download;
36+
new = not installed and seen for the first time;
37+
newer = the installer version is newer than available one.

src/app/pluginmanager/qgsapppluginmanagerinterface.cpp

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,7 @@ QgsAppPluginManagerInterface::~QgsAppPluginManagerInterface()
2929
}
3030

3131

32-
//! show the Plugin Manager window when remote repositories are fetched.
33-
//! Display a progress dialog when fetching.
34-
void QgsAppPluginManagerInterface::showPluginManagerWhenReady( )
35-
{
36-
}
37-
38-
39-
//! promptly show the Plugin Manager window and optionally open tab tabIndex:
32+
//! show the Plugin Manager window and optionally open tab tabIndex
4033
void QgsAppPluginManagerInterface::showPluginManager( int tabIndex )
4134
{
4235
mPluginManager->getCppPluginDescriptions();
@@ -45,43 +38,41 @@ void QgsAppPluginManagerInterface::showPluginManager( int tabIndex )
4538
//! switch to tab, if specified ( -1 means not specified )
4639
if ( tabIndex > -1 )
4740
{
48-
mPluginManager->selectTabItem( tabIndex );
41+
mPluginManager->selectTabItem( tabIndex );
4942
}
5043

5144
mPluginManager->exec();
5245
}
5346

5447

55-
//! remove metadata of all python plugins from the registry (c++ plugins stay)
48+
//! remove python plugins from the metadata registry (c++ plugins stay)
5649
void QgsAppPluginManagerInterface::clearPythonPluginMetadata()
5750
{
5851
mPluginManager->clearPythonPluginMetadata();
5952
}
6053

6154

6255
//! add a single plugin to the metadata registry
63-
void QgsAppPluginManagerInterface::addPluginMetadata( QMap<QString,QString> metadata )
56+
void QgsAppPluginManagerInterface::addPluginMetadata( QMap<QString, QString> metadata )
6457
{
65-
if ( metadata.isEmpty() || !metadata.contains("id") )
58+
if ( metadata.isEmpty() || !metadata.contains( "id" ) )
6659
{
67-
QgsDebugMsg( "Warning: incomplete metadata" );
68-
return;
60+
QgsDebugMsg( "Warning: incomplete metadata" );
61+
return;
6962
}
70-
mPluginManager->addPluginMetadata( metadata.value("id"), metadata );
63+
mPluginManager->addPluginMetadata( metadata.value( "id" ), metadata );
7164
}
7265

7366

74-
//! refresh listView model and textView content
67+
//! refresh plugin list model (and metadata browser content if necessary)
7568
void QgsAppPluginManagerInterface::reloadModel()
7669
{
7770
mPluginManager->reloadModelData();
7871
}
7972

8073

81-
82-
83-
//! get given plugin metadata
84-
QMap<QString,QString> * QgsAppPluginManagerInterface::pluginMetadata( QString key )
74+
//! return given plugin metadata
75+
QMap<QString, QString> * QgsAppPluginManagerInterface::pluginMetadata( QString key )
8576
{
8677
return mPluginManager->pluginMetadata( key );
8778
}
@@ -95,8 +86,7 @@ void QgsAppPluginManagerInterface::clearRepositoryList()
9586

9687

9788
//! add repository to the repository listWidget
98-
void QgsAppPluginManagerInterface::addToRepositoryList( QMap<QString,QString> repository )
89+
void QgsAppPluginManagerInterface::addToRepositoryList( QMap<QString, QString> repository )
9990
{
10091
mPluginManager->addToRepositoryList( repository );
10192
}
102-

src/app/pluginmanager/qgsapppluginmanagerinterface.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/** \ingroup gui
2424
* QgsPluginManagerInterface
25-
* Abstract base class to make QgsPluginManager available to plugins.
25+
* Abstract base class to make QgsPluginManager available to pyplugin_installer.
2626
*/
2727
class QgsAppPluginManagerInterface : public QgsPluginManagerInterface
2828
{
@@ -36,31 +36,25 @@ class QgsAppPluginManagerInterface : public QgsPluginManagerInterface
3636
//! Destructor
3737
~QgsAppPluginManagerInterface();
3838

39-
//! remove metadata of all python plugins from the registry (c++ plugins stay)
39+
//! remove python plugins from the metadata registry (c++ plugins stay)
4040
void clearPythonPluginMetadata();
4141

4242
//! add a single plugin to the metadata registry
43-
void addPluginMetadata( QMap<QString,QString> metadata );
43+
void addPluginMetadata( QMap<QString, QString> metadata );
4444

45-
//! refresh listView model and textView content
45+
//! refresh plugin list model (and metadata browser content if necessary)
4646
void reloadModel();
4747

48-
//! get given plugin metadata
48+
//! return given plugin metadata
4949
QMap<QString, QString> * pluginMetadata( QString key );
5050

5151
//! clear the repository listWidget
5252
void clearRepositoryList();
5353

5454
//! add repository to the repository listWidget
55-
void addToRepositoryList( QMap<QString,QString> repository );
55+
void addToRepositoryList( QMap<QString, QString> repository );
5656

57-
public slots:
58-
59-
//! show the Plugin Manager window when remote repositories are fetched.
60-
//! Display a progress dialog when fetching.
61-
void showPluginManagerWhenReady( );
62-
63-
//! promptly show the Plugin Manager window and optionally open tab tabIndex:
57+
//! show the Plugin Manager window and optionally open tab tabIndex
6458
void showPluginManager( int tabIndex = -1 );
6559

6660
private:

0 commit comments

Comments
 (0)