7 changes: 4 additions & 3 deletions python/plugins/GdalTools/GdalTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import qgis.utils

# Initialize Qt resources from file resources_rc.py
import resources_rc
Expand All @@ -39,7 +40,7 @@
# if the plugin is shipped with QGis catch the exception and
# display an error message
import os.path
qgisUserPluginPath = os.path.abspath( os.path.join( unicode( QgsApplication.qgisSettingsDirPath() ), "python") )
qgisUserPluginPath = qgis.utils.home_plugin_path
if not os.path.dirname(__file__).startswith( qgisUserPluginPath ):
title = QCoreApplication.translate( "GdalTools", "Plugin error" )
message = QCoreApplication.translate( "GdalTools", u'Unable to load {0} plugin. \nThe required "{1}" module is missing. \nInstall it and try again.' )
Expand Down Expand Up @@ -68,8 +69,8 @@ def __init__( self, iface ):

if QGis.QGIS_VERSION[0:3] < "1.5":
# For i18n support
userPluginPath = QFileInfo( QgsApplication.qgisUserDbFilePath() ).path() + "/python/plugins/GdalTools"
systemPluginPath = QgsApplication.prefixPath() + "/python/plugins/GdalTools"
userPluginPath = qgis.utils.home_plugin_path + "/GdalTools"
systemPluginPath = qgis.utils.sys_plugin_path + "/GdalTools"

overrideLocale = QSettings().value( "locale/overrideFlag", False, type=bool )
if not overrideLocale:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
pardir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.append(pardir)

sys.path.append('/usr/share/qgis/python/plugins')
sys.path.append( qgis.utils.sys_plugin_path )

(QGISAPP, CANVAS, IFACE, PARENT) = getQgisTestApp()

Expand Down
6 changes: 3 additions & 3 deletions python/pyplugin_installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def installPlugin(self, key, quiet=False):

if dlg.result():
infoString = (self.tr("Plugin installation failed"), dlg.result())
elif not QDir(QDir.cleanPath(QgsApplication.qgisSettingsDirPath() + "/python/plugins/" + key)).exists():
elif not QDir( qgis.utils.home_plugin_path + "/" + key ).exists():
infoString = (self.tr("Plugin has disappeared"), self.tr("The plugin seems to have been installed but I don't know where. Probably the plugin package contained a wrong named directory.\nPlease search the list of installed plugins. I'm nearly sure you'll find the plugin there, but I just can't determine which of them it is. It also means that I won't be able to determine if this plugin is installed and inform you about available updates. However the plugin may work. Please contact the plugin author and submit this issue."))
QApplication.setOverrideCursor(Qt.WaitCursor)
plugins.getAllInstalled()
Expand Down Expand Up @@ -336,7 +336,7 @@ def installPlugin(self, key, quiet=False):
dlg.exec_()
if dlg.result():
# revert installation
pluginDir = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/" + plugin["id"]
pluginDir = qgis.utils.home_python_pluginpath + "/" + plugin["id"]
removeDir(pluginDir)
if QDir(pluginDir).exists():
infoString = (self.tr("Plugin uninstall failed"), result)
Expand Down Expand Up @@ -380,7 +380,7 @@ def uninstallPlugin(self, key, quiet=False):
unloadPlugin(key)
except:
pass
pluginDir = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/" + plugin["id"]
pluginDir = qgis.utils.home_python_pluginpath + "/" + plugin["id"]
result = removeDir(pluginDir)
if result:
QMessageBox.warning(iface.mainWindow(), self.tr("Plugin uninstall failed"), result)
Expand Down
2 changes: 1 addition & 1 deletion python/pyplugin_installer/installer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def removeDir(path):
if QFile(path).exists():
result = QCoreApplication.translate("QgsPluginInstaller","Failed to remove the directory:")+"\n"+path+"\n"+QCoreApplication.translate("QgsPluginInstaller","Check permissions or remove it manually")
# restore plugin directory if removed by QDir().rmpath()
pluginDir = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins"
pluginDir = qgis.utils.home_plugin_path
if not QDir(pluginDir).exists():
QDir().mkpath(pluginDir)
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def requestFinished(self):
self.file.close()
self.stateChanged(0)
reply.deleteLater()
pluginDir = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins"
pluginDir = qgis.utils.home_plugin_path
tmpPath = self.file.fileName()
# make sure that the parent directory exists
if not QDir(pluginDir).exists():
Expand Down
13 changes: 0 additions & 13 deletions src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
QString lyrname,
QString source ) :
mTransparencyLevel( 255 ), // 0 is completely transparent
mValid( false ), // assume the layer is invalid
mDataSource( source ),
mLayerOrigName( lyrname ), // store the original name
Expand Down Expand Up @@ -693,18 +692,6 @@ void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSign
emit layerCrsChanged();
}

#if 0
unsigned int QgsMapLayer::getTransparency()
{
return mTransparencyLevel;
}

void QgsMapLayer::setTransparency( unsigned int theInt )
{
mTransparencyLevel = theInt;
}
#endif

QString QgsMapLayer::capitaliseLayerName( const QString& name )
{
// Capitalise the first letter of the layer name if requested
Expand Down
3 changes: 0 additions & 3 deletions src/core/qgsmaplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,6 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** Set error message */
void setError( const QgsError & theError ) { mError = theError;}

/** Transparency level for this layer should be 0-255 (255 being opaque) */
unsigned int mTransparencyLevel;

/** Extent of the layer */
QgsRectangle mExtent;

Expand Down
4 changes: 0 additions & 4 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ bool QgsRasterLayer::draw( QgsRenderContext& rendererContext )
{
QgsDebugMsg( "entered. (renderContext)" );

// Don't waste time drawing if transparency is at 0 (completely transparent)
if ( mTransparencyLevel == 0 )
return true;

QgsDebugMsg( "checking timestamp." );

// Check timestamp
Expand Down
2 changes: 2 additions & 0 deletions src/python/qgspythonutilsimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )

// tell the utils script where to look for the plugins
runString( "qgis.utils.plugin_paths = [" + pluginpaths.join( "," ) + "]" );
runString( "qgis.utils.sys_plugin_path = \"" + pluginsPath() + "\"" );
runString( "qgis.utils.home_plugin_path = " + homePluginsPath() );

#ifdef Q_OS_WIN
runString( "if oldhome: os.environ['HOME']=oldhome\n" );
Expand Down