generic: remove deprecated API

This commit is contained in:
Ivailo Monev 2015-02-28 03:27:54 +00:00
parent f2ee459f5e
commit 5333e9917d
160 changed files with 9 additions and 4886 deletions

View file

@ -89,12 +89,6 @@ QStringList ServiceTypeBrowser::serviceTypes() const
return d->m_servicetypes;
}
#ifndef KDE_NO_DEPRECATED
bool ServiceTypeBrowser::isRunning() const
{
return d->m_started;
}
#endif
}

View file

@ -39,12 +39,6 @@ QStringList ServiceTypeBrowser::serviceTypes() const
return QStringList();
}
#ifndef KDE_NO_DEPRECATED
bool ServiceTypeBrowser::isRunning() const
{
return false;
}
#endif
}
#include "moc_servicetypebrowser.cpp"

View file

@ -49,14 +49,6 @@ void ServiceTypeBrowser::startBrowse()
d->m_browser->startBrowse();
}
//@todo: remove on Monday
#ifndef KDE_NO_DEPRECATED
bool ServiceTypeBrowser::isRunning() const
{
return false;
}
#endif
void ServiceTypeBrowserPrivate::newService(DNSSD::RemoteService::Ptr srv)
{
QString type=srv->serviceName()+'.'+srv->type();

View file

@ -89,15 +89,6 @@ public:
*/
void startBrowse();
/**
* @deprecated
* This method is unnecessary, since it is safe to call startBrowse()
* multiple times.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool isRunning() const;
#endif
Q_SIGNALS:
/**
* Emitted when there are no more services of this type

View file

@ -143,16 +143,6 @@ bool View::insertText (const QString &text )
return doc->insertText(cursorPosition(),text,blockSelection());
}
#ifndef KDE_NO_DEPRECATED
Plugin *KTextEditor::createPlugin ( KService::Ptr service, QObject *parent )
{
QString error;
Plugin* plugin = service->createInstance<KTextEditor::Plugin>(parent, QVariantList(), &error);
if (!plugin)
kWarning() << error;
return plugin;
}
#endif
struct KTextEditorFactorySet : public QSet<KPluginFactory*>
{

View file

@ -190,22 +190,6 @@ class KTEXTEDITOR_EXPORT Plugin : public QObject
class PluginPrivate* const d;
};
/**
* Create a plugin represented by \p service with parent object \p parent.
* To get the KService object you usually use KServiceTypeTrader. Example
* \code
* KService::List list = KServiceTypeTrader::self()->query("KTextEditor/Plugin");
*
* foreach(const KService::Ptr &service, list) {
* // do something with service
* }
* \endcode
* \return the plugin or NULL if it could not be loaded
*/
#ifndef KDE_NO_DEPRECATED
KTEXTEDITOR_EXPORT_DEPRECATED Plugin *createPlugin ( KService::Ptr service, QObject *parent );
#endif
}
#endif

View file

@ -743,21 +743,7 @@ bool KConfig::isGroupImmutableImpl(const QByteArray& aGroup) const
return isImmutable() || d->entryMap.getEntryOption(aGroup, 0, 0, KEntryMap::EntryImmutable);
}
#ifndef KDE_NO_DEPRECATED
void KConfig::setForceGlobal(bool b)
{
Q_D(KConfig);
d->bForceGlobal = b;
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KConfig::forceGlobal() const
{
Q_D(const KConfig);
return d->bForceGlobal;
}
#endif
KConfigGroup KConfig::groupImpl(const QByteArray &group)
{

View file

@ -342,33 +342,6 @@ public:
bool isImmutable() const;
/// @}
/// @{ global
/**
* @deprecated
*
* Forces all following write-operations to be performed on @c kdeglobals,
* independent of the @c Global flag in writeEntry().
*
* @param force true to force writing to kdeglobals
* @see forceGlobal
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setForceGlobal(bool force);
#endif
/**
* @deprecated
*
* Returns whether all entries are being written to @c kdeglobals.
*
* @return @c true if all entries are being written to @c kdeglobals
* @see setForceGlobal
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool forceGlobal() const;
#endif
/// @}
/// @reimp
QStringList groupList() const;

View file

@ -29,9 +29,6 @@
#include <kdecore_export.h>
#include <kconfigbase.h>
#include <kdebug.h>
#ifndef KDE_NO_DEPRECATED
#include <kgenericfactory.h>
#endif
#include <klocale.h>
#include <kpluginfactory.h>
#include <kpluginloader.h>

View file

@ -552,23 +552,7 @@ void KConfigGroup::deleteGroup(WriteConfigFlags flags)
config()->deleteGroup(d->fullName(), flags);
}
#ifndef KDE_NO_DEPRECATED
void KConfigGroup::changeGroup( const QString &group )
{
Q_ASSERT_X(isValid(), "KConfigGroup::changeGroup", "accessing an invalid group");
d.detach();
d->mName = group.toUtf8();
}
#endif
#ifndef KDE_NO_DEPRECATED
void KConfigGroup::changeGroup( const char *group )
{
Q_ASSERT_X(isValid(), "KConfigGroup::changeGroup", "accessing an invalid group");
d.detach();
d->mName = group;
}
#endif
QString KConfigGroup::name() const
{

View file

@ -143,25 +143,6 @@ public:
*/
const KConfig* config() const;
/**
* Changes the group of the object
*
* @deprecated
* Create another KConfigGroup from the parent of this group instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void changeGroup(const QString &group);
#endif
/**
* Overload for changeGroup(const QString&)
*
* @deprecated
* Create another KConfigGroup from the parent of this group instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void changeGroup(const char *group);
#endif
/**
* Copies the entries in this group to another configuration object
*

View file

@ -1195,16 +1195,6 @@ KCoreConfigSkeleton::ItemLongLong *KCoreConfigSkeleton::addItemLongLong( const Q
return item;
}
#ifndef KDE_NO_DEPRECATED
KCoreConfigSkeleton::ItemLongLong *KCoreConfigSkeleton::addItemInt64(
const QString& name,
qint64 &reference,
qint64 defaultValue,
const QString & key)
{
return addItemLongLong(name, reference, defaultValue, key);
}
#endif
KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemULongLong( const QString &name, quint64 &reference,
quint64 defaultValue, const QString &key )
@ -1216,16 +1206,6 @@ KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemULongLong( const
return item;
}
#ifndef KDE_NO_DEPRECATED
KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemUInt64(
const QString & name,
quint64 &reference,
quint64 defaultValue,
const QString & key)
{
return addItemULongLong(name, reference, defaultValue, key);
}
#endif
KCoreConfigSkeleton::ItemDouble *KCoreConfigSkeleton::addItemDouble( const QString &name, double &reference,
double defaultValue, const QString &key )

View file

@ -599,9 +599,6 @@ public:
qint64 mMin;
qint64 mMax;
};
#ifndef KDE_NO_DEPRECATED
typedef KDE_DEPRECATED ItemLongLong ItemInt64;
#endif
/**
* Class for handling enums.
@ -732,9 +729,6 @@ public:
quint64 mMin;
quint64 mMax;
};
#ifndef KDE_NO_DEPRECATED
typedef KDE_DEPRECATED ItemULongLong ItemUInt64;
#endif
/**
* Class for handling a floating point preference item.
@ -1171,16 +1165,6 @@ public:
qint64 defaultValue = 0,
const QString & key = QString());
/**
* @deprecated
* Use addItemLongLong().
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED ItemLongLong *addItemInt64( const QString& name, qint64 &reference,
qint64 defaultValue = 0,
const QString & key = QString());
#endif
/**
* Register an item of type quint64
*
@ -1196,16 +1180,6 @@ public:
quint64 defaultValue = 0,
const QString & key = QString());
/**
* @deprecated
* Use addItemULongLong().
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED ItemULongLong *addItemUInt64(const QString & name, quint64 &reference,
quint64 defaultValue = 0,
const QString & key = QString());
#endif
/**
* Register an item of type double.
*

View file

@ -219,18 +219,6 @@ class QObject;
KDECORE_EXPORT QDebug operator<<(QDebug s, const KUrl &url);
KDECORE_EXPORT QDebug operator<<(QDebug s, const KDateTime &time);
#ifndef KDE_NO_DEPRECATED
class KDE_DEPRECATED kndbgstream { };
typedef QDebug kdbgstream;
static inline KDE_DEPRECATED QDebug kdDebug(int area = KDE_DEFAULT_DEBUG_AREA) { return kDebug(area); }
static inline KDE_DEPRECATED QDebug kdWarning(int area = KDE_DEFAULT_DEBUG_AREA) { return kWarning(area); }
static inline KDE_DEPRECATED QDebug kdError(int area = KDE_DEFAULT_DEBUG_AREA) { return kError(area); }
static inline KDE_DEPRECATED QDebug kdFatal(int area = KDE_DEFAULT_DEBUG_AREA) { return kFatal(area); }
inline KDE_DEPRECATED QString kdBacktrace(int levels=-1) { return kBacktrace( levels ); }
static inline KDE_DEPRECATED QDebug kndDebug() { return kDebugDevNull(); }
#endif
class WrongSyntax {};

View file

@ -516,12 +516,6 @@ KUrl::operator QVariant() const
return qVariantFromValue(*this);
}
#ifndef KDE_NO_DEPRECATED
bool KUrl::cmp( const KUrl &u, bool ignore_trailing ) const
{
return equals( u, ignore_trailing ? CompareWithoutTrailingSlash : EqualsOptions(0) );
}
#endif
bool KUrl::equals( const KUrl &_u, const EqualsOptions& options ) const
{
@ -1446,89 +1440,7 @@ void KUrl::_setEncodedUrl(const QByteArray& url)
setUrl(QString::fromUtf8(url), QUrl::TolerantMode);
}
#ifndef KDE_NO_DEPRECATED
bool urlcmp( const QString& _url1, const QString& _url2 )
{
return QUrl( _url1, QUrl::TolerantMode ) == QUrl( _url2, QUrl::TolerantMode );
#if 0
// Both empty ?
if ( _url1.isEmpty() && _url2.isEmpty() )
return true;
// Only one empty ?
if ( _url1.isEmpty() || _url2.isEmpty() )
return false;
KUrl::List list1 = KUrl::split( _url1 );
KUrl::List list2 = KUrl::split( _url2 );
// Malformed ?
if ( list1.isEmpty() || list2.isEmpty() )
return false;
return ( list1 == list2 );
#endif
}
#endif
#ifndef KDE_NO_DEPRECATED
bool urlcmp( const QString& _url1, const QString& _url2, const KUrl::EqualsOptions& _options )
{
// Both empty ?
if (_url1.isEmpty() && _url2.isEmpty())
return true;
// Only one empty ?
if (_url1.isEmpty() || _url2.isEmpty())
return false;
KUrl u1(_url1);
KUrl u2(_url2);
return u1.equals(u2, _options);
#if 0 // kde3 code that supported nested urls
KUrl::List list1 = KUrl::split( _url1 );
KUrl::List list2 = KUrl::split( _url2 );
// Malformed ?
if ( list1.isEmpty() || list2.isEmpty() )
return false;
int size = list1.count();
if ( list2.count() != size )
return false;
if ( _ignore_ref )
{
(*list1.begin()).setRef(QString());
(*list2.begin()).setRef(QString());
}
KUrl::List::Iterator it1 = list1.begin();
KUrl::List::Iterator it2 = list2.begin();
for( ; it1 != list1.end() ; ++it1, ++it2 )
if ( !(*it1).equals( *it2, _ignore_trailing ) )
return false;
return true;
#endif
}
#endif
// static
#ifndef KDE_NO_DEPRECATED
KUrl KUrl::fromPathOrUrl( const QString& text )
{
KUrl url;
if ( !text.isEmpty() )
{
if (!QDir::isRelativePath(text) || text[0] == QLatin1Char('~'))
url.setPath( text );
else
url = KUrl( text );
}
return url;
}
#endif
static QString _relativePath(const QString &base_dir, const QString &path, bool &isParent)
{

View file

@ -883,22 +883,6 @@ public:
*/
operator QVariant() const;
/**
* The same as equals(), just with a less obvious name.
* Compares this url with @p u.
* @param u the URL to compare this one with.
* @param ignore_trailing set to true to ignore trailing '/' characters.
* @return True if both urls are the same. If at least one of the urls is invalid,
* false is returned.
* @see operator==. This function should be used if you want to
* ignore trailing '/' characters.
* @deprecated Use equals() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool cmp( const KUrl &u, bool ignore_trailing = false ) const;
#endif
/**
* Flags to be used in URL comparison functions like equals, or urlcmp
*/
@ -1007,15 +991,6 @@ public:
*/
static KUrl fromPath( const QString& text );
/**
* \deprecated
* Since KDE4 you can pass both urls and paths to the KUrl constructors.
* Use KUrl(text) instead.
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED KUrl fromPathOrUrl( const QString& text );
#endif
/**
* Creates a KUrl from a string, using the standard conventions for mime data
* (drag-n-drop or copy-n-paste).
@ -1043,55 +1018,6 @@ public:
const MetaDataMap& metaData = MetaDataMap(),
MimeDataFlags flags = DefaultMimeDataFlags ) const;
/**
* Convert unicoded string to local encoding and use %-style
* encoding for all common delimiters / non-ascii characters.
* @param str String to encode (can be QString()).
* @return the encoded string
*
* @deprecated use QUrl::toPercentEncoding instead, but note that it
* returns a QByteArray and not a QString. Which makes sense since
* everything is 7 bit (ascii) after being percent-encoded.
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED QString encode_string(const QString &str) {
return QString::fromLatin1( QUrl::toPercentEncoding( str ).constData() ); //krazy:exclude=qclasses
}
#endif
/**
* Convert unicoded string to local encoding and use %-style
* encoding for all common delimiters / non-ascii characters
* as well as the slash '/'.
* @param str String to encode
*
* @deprecated use QUrl::toPercentEncoding(str,"/") instead, but note that it
* returns a QByteArray and not a QString. Which makes sense since
* everything is 7 bit (ascii) after being percent-encoded.
*
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED QString encode_string_no_slash(const QString &str) {
return QString::fromLatin1( QUrl::toPercentEncoding( str, "/" ).constData() ); //krazy:exclude=qclasses
}
#endif
/**
* Decode %-style encoding and convert from local encoding to unicode.
* Reverse of encode_string()
* @param str String to decode (can be QString()).
*
* @deprecated use QUrl::fromPercentEncoding(encodedURL) instead, but
* note that it takes a QByteArray and not a QString. Which makes sense since
* everything is 7 bit (ascii) when being percent-encoded.
*
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED QString decode_string(const QString &str) {
return QUrl::fromPercentEncoding( str.toLatin1() ); //krazy:exclude=qclasses
}
#endif
/**
* Convenience function.
@ -1159,34 +1085,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(KUrl::DirectoryOptions)
Q_DECLARE_METATYPE(KUrl)
Q_DECLARE_METATYPE(KUrl::List)
/**
* \relates KUrl
* Compares URLs. They are parsed, split and compared.
* Two malformed URLs with the same string representation
* are nevertheless considered to be unequal.
* That means no malformed URL equals anything else.
* @deprecated use KUrl(_url1).equals(KUrl(_url2)) instead.
*/
#ifndef KDE_NO_DEPRECATED
KDECORE_EXPORT_DEPRECATED bool urlcmp( const QString& _url1, const QString& _url2 ); // KDE5: remove, KUrl::equals is better API
#endif
/**
* \relates KUrl
* Compares URLs. They are parsed, split and compared.
* Two malformed URLs with the same string representation
* are nevertheless considered to be unequal.
* That means no malformed URL equals anything else.
*
* @param _url1 A reference URL
* @param _url2 A URL that will be compared with the reference URL
* @param options a set of KUrl::EqualsOption flags
* @deprecated use KUrl(_url1).equals(KUrl(_url2), options) instead.
*/
#ifndef KDE_NO_DEPRECATED
KDECORE_EXPORT_DEPRECATED bool urlcmp( const QString& _url1, const QString& _url2, const KUrl::EqualsOptions& options ); // KDE5: remove, KUrl::equals is better API
#endif
KDECORE_EXPORT uint qHash(const KUrl& kurl);
#endif

View file

@ -371,14 +371,6 @@ QString KStandardDirs::kfsstnd_xdg_data_prefixes()
return d->xdgdata_prefixes.join(QString(QLatin1Char(KPATH_SEPARATOR)));
}
#ifndef KDE_NO_DEPRECATED
bool KStandardDirs::addResourceType( const char *type,
const QString& relativename,
bool priority )
{
return addResourceType( type, 0, relativename, priority);
}
#endif
bool KStandardDirs::addResourceType( const char *type,
const char *basetype,
@ -1222,12 +1214,6 @@ static void tokenize(QStringList& tokens, const QString& str,
}
}
#ifndef KDE_NO_DEPRECATED
QString KStandardDirs::kde_default(const char *type)
{
return QString(QLatin1Char('%')) + QString::fromLatin1(type) + QLatin1Char('/');
}
#endif
QString KStandardDirs::saveLocation(const char *type,
const QString& suffix,

View file

@ -227,34 +227,6 @@ public:
*/
void addXdgDataPrefix( const QString& dir );
/**
* Adds suffixes for types.
*
* You may add as many as you need, but it is advised that there
* is exactly one to make writing definite.
* All basic types are added by addKDEDefaults(),
* but for those you can add more relative paths as well.
*
* The later a suffix is added, the higher its priority. Note, that the
* suffix should end with / but doesn't have to start with one (as prefixes
* should end with one). So adding a suffix for app_pics would look
* like KGlobal::dirs()->addResourceType("app_pics", "data" ,"app/pics");
*
* @param type Specifies a short descriptive string to access
* files of this type.
* @param relativename Specifies a directory relative to the root
* of the KFSSTND.
* @param priority if true, the directory is added before any other,
* otherwise after
* @return true if successful, false otherwise.
*
* @deprecated, use addResourceType(type, 0, relativename, priority)
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool addResourceType( const char *type,
const QString& relativename, bool priority = true );
#endif
/**
* Adds suffixes for types.
*
@ -649,9 +621,6 @@ public:
* @see locate()
* @see locateLocal()
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED QString kde_default(const char *type);
#endif
/**
* @internal (for use by sycoca only)

View file

@ -139,36 +139,7 @@ int KToolInvocation::startServiceInternal(const char *_function,
return reply.arguments().at(0).toInt();
}
#ifndef KDE_NO_DEPRECATED
int
KToolInvocation::startServiceByName( const QString& _name, const QString &URL,
QString *error, QString *serviceName, int *pid,
const QByteArray& startup_id, bool noWait )
{
if (!isMainThreadActive(error))
return EINVAL;
QStringList URLs;
if (!URL.isEmpty())
URLs.append(URL);
return self()->startServiceInternal("start_service_by_name",
_name, URLs, error, serviceName, pid, startup_id, noWait);
}
#endif
#ifndef KDE_NO_DEPRECATED
int
KToolInvocation::startServiceByName( const QString& _name, const QStringList &URLs,
QString *error, QString *serviceName, int *pid,
const QByteArray& startup_id, bool noWait )
{
if (!isMainThreadActive(error))
return EINVAL;
return self()->startServiceInternal("start_service_by_name",
_name, URLs, error, serviceName, pid, startup_id, noWait);
}
#endif
int
KToolInvocation::startServiceByDesktopPath( const QString& _name, const QString &URL,

View file

@ -182,60 +182,6 @@ public:
// replacements for setLaunchEnv and for "making sure kdeinit/klauncher is running".
// (We could do the last two without waiting, of course).
/**
* Starts a service based on the (translated) name of the service.
* E.g. "Web Browser"
*
* @param _name the name of the service
* @param URL if not empty this URL is passed to the service
* @param error On failure, error contains a description of the error
* that occurred. If the pointer is 0, the argument will be
* ignored
* @param serviceName On success, serviceName contains the DCOP name
* under which this service is available. If empty, the service does
* not provide DCOP services. If the pointer is 0 the argument
* will be ignored
* @param pid On success, the process id of the new service will be written
* here. If the pointer is 0, the argument will be ignored.
* @param startup_id for app startup notification, "0" for none,
* "" ( empty string ) is the default
* @param noWait if set, the function does not wait till the service is running.
* @return an error code indicating success (== 0) or failure (> 0).
* @deprecated Use startServiceByDesktopName or startServiceByDesktopPath
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED static int startServiceByName( const QString& _name, const QString &URL,
QString *error=0, QString *serviceName=0, int *pid=0,
const QByteArray &startup_id = QByteArray(), bool noWait = false );
#endif
/**
* Starts a service based on the (translated) name of the service.
* E.g. "Web Browser"
*
* @param _name the name of the service
* @param URLs if not empty these URLs will be passed to the service
* @param error On failure, @p error contains a description of the error
* that occurred. If the pointer is 0, the argument will be
* ignored
* @param serviceName On success, @p serviceName contains the DCOP name
* under which this service is available. If empty, the service does
* not provide DCOP services. If the pointer is 0 the argument
* will be ignored
* @param pid On success, the process id of the new service will be written
* here. If the pointer is 0, the argument will be ignored.
* @param startup_id for app startup notification, "0" for none,
* "" ( empty string ) is the default
* @param noWait if set, the function does not wait till the service is running.
* @return an error code indicating success (== 0) or failure (> 0).
* @deprecated Use startServiceByDesktopName or startServiceByDesktopPath
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED static int startServiceByName( const QString& _name, const QStringList &URLs=QStringList(),
QString *error=0, QString *serviceName=0, int *pid=0,
const QByteArray &startup_id = QByteArray(), bool noWait = false );
#endif
/**
* Starts a service based on the desktop path of the service.
* E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop"

View file

@ -614,18 +614,6 @@ QStringList KCharsets::availableEncodingNames() const
return available;
}
#ifndef KDE_NO_DEPRECATED
QString KCharsets::languageForEncoding( const QString &encoding ) const
{
const char* lang = kcharsets_array_search( (const char*)language_for_encoding_string,
language_for_encoding_indices,
encoding.toUtf8().constData() );
if ( lang )
return i18nc( "@item Text character set", lang );
else
return i18nc( "@item Text character set", "Other" );
}
#endif
QString KCharsets::descriptionForEncoding( const QString& encoding ) const
{

View file

@ -137,17 +137,6 @@ public:
*/
QList<QStringList> encodingsByScript() const;
/**
* Returns the language the encoding is used for.
* @param encoding the encoding for the language
* @return the language of the encoding
* @deprecated Please use descriptionForEncoding instead.
* This function will be removed before KDE4 is released.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QString languageForEncoding( const QString &encoding ) const;
#endif
/**
* @brief Returns a long description for an encoding name.
* @param encoding the encoding for the language

View file

@ -194,14 +194,6 @@ KEncodingProber::ProberState KEncodingProber::state() const
return d->proberState;
}
//DEPRECATED, do *not* use
#ifndef KDE_NO_DEPRECATED
const char* KEncodingProber::encodingName() const
{
return qstrdup(encoding().constData());
}
#endif
QByteArray KEncodingProber::encoding() const
{
if (!d->prober)

View file

@ -129,9 +129,6 @@ public:
* @warning The returned string is allocated with strdup, so some memory is leaked with every call.
* @deprecated Use encoding() instead, which returns a QByteArray.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED const char* encodingName() const;
#endif
/**
* @returns a QByteArray with the name of the best encoding it has guessed so far

View file

@ -70,17 +70,6 @@ public:
void clearRule(const QSslCertificate &cert, const QString &hostName);
KSslCertificateRule rule(const QSslCertificate &cert, const QString &hostName) const;
// do not use, it does nothing!
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setRootCertificates(const QList<QSslCertificate> &rootCertificates)
{ Q_UNUSED(rootCertificates) }
#endif
// use caCertificates() instead
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QList<QSslCertificate> rootCertificates() const
{ return caCertificates(); }
#endif
QList<QSslCertificate> caCertificates() const;
static QList<KSslError> nonIgnorableErrors(const QList<KSslError> &);

View file

@ -504,15 +504,6 @@ QString KMimeType::comment( const KUrl &url) const
return d->comment(url);
}
#ifndef KDE_NO_DEPRECATED
QString KMimeType::parentMimeType() const
{
const QStringList parents = parentMimeTypes();
if (!parents.isEmpty())
return parents.first();
return QString();
}
#endif
bool KMimeTypePrivate::inherits(const QString& mime) const
{

View file

@ -318,20 +318,6 @@ public:
/// Return true if this mimetype is the default mimetype
bool isDefault() const;
/**
* If this mimetype is a subclass of another mimetype,
* return the name of the parent.
*
* @return the parent mime type, or QString() if not set
*
* @deprecated this method does not support multiple inheritance,
* which is actually part of the shared-mime-info standard.
* Use is(), parentMimeTypes(), or allParentMimeTypes() instead of parentMimeType()
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QString parentMimeType() const;
#endif
/**
* If this mimetype is a subclass of one or more other mimetypes,
* return the list of those mimetypes.

View file

@ -442,14 +442,6 @@ bool KService::hasServiceType( const QString& serviceType ) const
return false;
}
#ifndef KDE_NO_DEPRECATED
bool KService::hasMimeType( const KServiceType* ptr ) const
{
if (!ptr) return false;
return hasMimeType(ptr->name());
}
#endif
bool KService::hasMimeType(const QString& mimeType) const
{
@ -605,12 +597,6 @@ KService::List KService::allServices()
return KServiceFactory::self()->allServices();
}
#ifndef KDE_NO_DEPRECATED
KService::Ptr KService::serviceByName( const QString& _name )
{
return KServiceFactory::self()->findServiceByName( _name );
}
#endif
KService::Ptr KService::serviceByDesktopPath( const QString& _name )
{
@ -835,13 +821,6 @@ bool KService::isApplication() const
return d->m_strType == QLatin1String("Application");
}
#ifndef KDE_NO_DEPRECATED
QString KService::type() const
{
Q_D(const KService);
return d->m_strType;
}
#endif
QString KService::exec() const
{
@ -878,14 +857,6 @@ bool KService::terminal() const
return d->m_bTerminal;
}
// KDE5: remove and port code to entryPath?
#ifndef KDE_NO_DEPRECATED
QString KService::desktopEntryPath() const
{
return entryPath();
}
#endif
QString KService::desktopEntryName() const
{
Q_D(const KService);

View file

@ -24,9 +24,6 @@
#include "kserviceaction.h"
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#ifndef KDE_NO_DEPRECATED
#include <klibloader.h>
#endif
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <ksycocaentry.h>
@ -98,15 +95,6 @@ public:
*/
bool isApplication() const;
/**
* Returns the type of the service.
* @return the type of the service ("Application" or "Service")
* @deprecated use isApplication()
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QString type() const;
#endif
/**
* Returns the executable.
* @return the command that the service executes,
@ -156,24 +144,6 @@ public:
*/
QString username() const;
/**
* Returns the path to the location where the service desktop entry
* is stored.
*
* This is a relative path if the desktop entry was found in any
* of the locations pointed to by $KDEDIRS (e.g. "Internet/kppp.desktop")
* It is a full path if the desktop entry originates from another
* location.
*
* @deprecated use entryPath() instead
*
* @return the path of the service's desktop file,
* or QString() if not set
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QString desktopEntryPath() const;
#endif
/**
* Returns the filename of the service desktop entry without any
* extension. E.g. "kppp"
@ -285,28 +255,6 @@ public:
*/
bool hasServiceType( const QString& serviceTypePtr ) const;
/**
* Checks whether the service supports this mime type
* @param mimeTypePtr The name of the mime type you are
* interested in determining whether this service supports.
*
* Note that if you only have the name of the mime type, you have to look it up
* with KMimeType::mimeType( mimetype ) and use .data() on the result (this is
* because KService doesn't know KMimeType for dependency reasons)
*
* Warning this method will fail to return true if this KService isn't from ksycoca
* (i.e. it was created with a full path or a KDesktopFile) *and* the mimetype
* isn't explicited listed in the .desktop file but a parent mimetype is.
* For this reason you should generally get KServices with KMimeTypeTrader
* or one of the KService::serviceBy methods.
*
* @return true if the mime type you specified is supported, otherwise false.
* @deprecated, use hasMimeType(QString)
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool hasMimeType( const KServiceType* mimeTypePtr ) const;
#endif
/**
* Checks whether the service supports this mime type
* @param mimeType The name of the mime type you are
@ -439,20 +387,6 @@ public:
*/
void setExec(const QString& exec);
/**
* Find a service by name, i.e. the translated Name field. Don't use this.
* Use serviceByDesktopPath or serviceByStorageId instead.
*
* @param _name the name to search
* @return a pointer to the requested service or 0 if the service is
* unknown.
* @em Very @em important: Don't store the result in a KService* !
* @deprecated there is never a good reason to use this method.
*/
#ifndef KDE_NO_DEPRECATED
static Ptr serviceByName( const QString& _name ); // KDE5: remove
#endif
/**
* Find a service based on its path as returned by entryPath().
* It's usually better to use serviceByStorageId() instead.
@ -583,100 +517,6 @@ public:
return 0;
}
/**
* @deprecated Use the non-static service->createInstance<T>(parent, args, &error)
*/
#ifndef KDE_NO_DEPRECATED
template <class T>
static KDE_DEPRECATED T *createInstance(const KService::Ptr &service, QObject *parent = 0,
const QVariantList &args = QVariantList(), QString *error = 0)
{
return service->createInstance<T>(parent, args, error);
}
#endif
/**
* @deprecated Use the non-static service->createInstance<T>(parent, args, &error)
* where args is a QVariantList rather than a QStringList
*/
#ifndef KDE_NO_DEPRECATED
template <class T>
static KDE_DEPRECATED T *createInstance( const KService::Ptr &service,
QObject *parent,
const QStringList &args,
int *error = 0 )
{
const QString library = service->library();
if ( library.isEmpty() ) {
if ( error )
*error = KLibLoader::ErrServiceProvidesNoLibrary;
return 0;
}
return KLibLoader::createInstance<T>( library, parent, args, error );
}
#endif
/**
* This template allows to create a component from a list of services,
* usually coming from a trader query. You probably want to use KServiceTypeTrader instead.
*
* @deprecated Use KServiceTypeTrader::createInstanceFromQuery instead
*
* @param begin The start iterator to the service describing the library to open
* @param end The end iterator to the service describing the library to open
* @param parent The parent object (see QObject constructor)
* @param args A list of string arguments, passed to the factory and possibly
* to the component (see KLibFactory)
* @param error see KLibLoader
* @return A pointer to the newly created object or a null pointer if the
* factory was unable to create an object of the given type.
*/
#ifndef KDE_NO_DEPRECATED
template <class T, class ServiceIterator>
static KDE_DEPRECATED T *createInstance(ServiceIterator begin, ServiceIterator end, QObject *parent = 0,
const QVariantList &args = QVariantList(), QString *error = 0)
{
for (; begin != end; ++begin) {
KService::Ptr service = *begin;
if (error) {
error->clear();
}
T *component = createInstance<T>(service, parent, args, error);
if (component) {
return component;
}
}
if (error) {
*error = KLibLoader::errorString(KLibLoader::ErrNoServiceFound);
}
return 0;
}
#endif
#ifndef KDE_NO_DEPRECATED
template <class T, class ServiceIterator>
static KDE_DEPRECATED T *createInstance( ServiceIterator begin, ServiceIterator end,
QObject *parent,
const QStringList &args,
int *error = 0 )
{
for (; begin != end; ++begin ) {
KService::Ptr service = *begin;
if ( error )
*error = 0;
T *component = createInstance<T>( service, parent, args, error );
if ( component )
return component;
}
if ( error )
*error = KLibLoader::ErrNoServiceFound;
return 0;
}
#endif
protected:
friend class KMimeAssociations;
friend class KBuildServiceFactory;

View file

@ -700,13 +700,6 @@ QStringList KServiceGroup::layoutInfo() const
return d->sortOrder;
}
#ifndef KDE_NO_DEPRECATED
KServiceGroup::Ptr
KServiceGroup::baseGroup( const QString & _baseGroupName )
{
return KServiceGroupFactory::self()->findBaseGroup(_baseGroupName, true);
}
#endif
KServiceGroup::Ptr
KServiceGroup::root()

View file

@ -240,19 +240,6 @@ public:
*/
QString directoryEntryPath() const;
/**
* Returns the group for the given baseGroupName.
* Can return 0L if the directory (or the .directory file) was deleted.
* @return the base group with the given name, or 0 if not available.
*
* This mechanism was fragile and isn't used in kde4 anymore.
* @deprecated Use a servicetype and a proper trader query instead, for a better
* way of finding related services.
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED Ptr baseGroup( const QString &baseGroupName );
#endif
/**
* Returns the root service group.
* @return the root service group

View file

@ -235,14 +235,6 @@ QString KServiceType::comment() const
return d->comment();
}
// ## KDE4: remove?
#ifndef KDE_NO_DEPRECATED
QString KServiceType::desktopEntryPath() const
{
return entryPath();
}
#endif
bool KServiceType::isDerived() const
{
Q_D(const KServiceType);

View file

@ -72,9 +72,6 @@ public:
* For instance inode/directory.desktop, or kpart.desktop
* @return the path of the desktop file
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QString desktopEntryPath() const;
#endif
/**
* Checks whether this service type inherits another one.

View file

@ -193,29 +193,6 @@ public:
return 0;
}
/**
* @deprecated Use
* createInstanceFromQuery(const QString&, const QString&, QObject*, const QVariantList&, QString*)
* instead
*/
#ifndef KDE_NO_DEPRECATED
template <class T>
static KDE_DEPRECATED T *createInstanceFromQuery(const QString &serviceType, const QString &constraint,
QObject *parent, const QStringList &args, int *error = 0)
{
const KService::List offers = KServiceTypeTrader::self()->query(serviceType, constraint);
if (offers.isEmpty()) {
if (error) {
*error = KLibLoader::ErrNoServiceFound;
}
return 0;
}
return KService::createInstance<T>(offers.begin(), offers.end(), parent, args, error);
}
#endif
/**
* @internal (public for KMimeTypeTrader)
*/

View file

@ -332,12 +332,6 @@ void KSycoca::addFactory( KSycocaFactory *factory )
d->addFactory(factory);
}
#ifndef KDE_NO_DEPRECATED
bool KSycoca::isChanged(const char *type)
{
return self()->d->changeList.contains(QString::fromLatin1(type));
}
#endif
void KSycoca::notifyDatabaseChanged(const QStringList &changeList)
{
@ -350,9 +344,6 @@ void KSycoca::notifyDatabaseChanged(const QStringList &changeList)
d->closeDatabase();
// Now notify applications
#ifndef KDE_NO_DEPRECATED
emit databaseChanged();
#endif
emit databaseChanged(changeList);
}
@ -562,12 +553,6 @@ void KSycoca::flagError()
}
}
#ifndef KDE_NO_DEPRECATED
bool KSycoca::readError() // KDE5: remove
{
return false;
}
#endif
bool KSycoca::isBuilding()
{

View file

@ -153,38 +153,13 @@ public:
*/
static void disableAutoRebuild();
/**
* When you receive a "databaseChanged" signal, you can query here if
* a change has occurred in a specific resource type.
* @see KStandardDirs for the various resource types.
*
* This method is meant to be called from the GUI thread only.
* @deprecated use the signal databaseChanged(QStringList) instead.
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED bool isChanged(const char *type);
#endif
/**
* A read error occurs.
* @internal
*/
static void flagError();
/// @deprecated
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED bool readError();
#endif
Q_SIGNALS:
/**
* Connect to this to get notified when the database changes
* @deprecated use the databaseChanged(QStringList) signal
*/
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void databaseChanged(); // KDE5 TODO: remove
#endif
/**
* Connect to this to get notified when the database changes
* Example: when mimetype definitions have changed, applications showing
@ -203,9 +178,6 @@ protected:
KSycocaFactoryList* factories();
// @internal was for kbuildsycoca
#ifndef KDE_NO_DEPRECATED
QDataStream *m_str_deprecated; // KDE5: REMOVE
#endif
// @internal used by factories and kbuildsycoca
QDataStream*& stream();
friend class KSycocaFactory;

View file

@ -642,27 +642,12 @@ void KConfigTest::testChangeGroup()
KConfigGroup sc3(&sc, "Hello");
QCOMPARE(sc3.name(), QString("Hello"));
KConfigGroup newGroup(sc3);
#ifndef KDE_NO_DEPRECATED
newGroup.changeGroup("FooBar"); // deprecated!
QCOMPARE(newGroup.name(), QString("FooBar"));
QCOMPARE(sc3.name(), QString("Hello")); // unchanged
// Write into the "changed group" and check that it works
newGroup.writeEntry("InFooBar", "FB");
QCOMPARE(KConfigGroup(&sc, "FooBar").entryMap().value("InFooBar"), QString("FB"));
QCOMPARE(KConfigGroup(&sc, "Hello").entryMap().value("InFooBar"), QString());
#endif
KConfigGroup rootGroup(sc.group(""));
QCOMPARE(rootGroup.name(), QString("<default>"));
KConfigGroup sc32(rootGroup.group("Hello"));
QCOMPARE(sc32.name(), QString("Hello"));
KConfigGroup newGroup2(sc32);
#ifndef KDE_NO_DEPRECATED
newGroup2.changeGroup("FooBar"); // deprecated!
QCOMPARE(newGroup2.name(), QString("FooBar"));
QCOMPARE(sc32.name(), QString("Hello")); // unchanged
#endif
}
// Simple test for deleteEntry

View file

@ -1415,10 +1415,6 @@ void KUrlTest::testComparisons()
QString ucmp1 = "ftp://ftp.de.kde.org/dir";
QString ucmp2 = "ftp://ftp.de.kde.org/dir/";
#ifndef KDE_NO_DEPRECATED
QVERIFY(!urlcmp(ucmp1, ucmp2));
QVERIFY(urlcmp(ucmp1, ucmp2, KUrl::CompareWithoutTrailingSlash)); //only slash difference, ignore_trailing
#endif
{
KUrl u1(ucmp1);
@ -1432,11 +1428,6 @@ void KUrlTest::testComparisons()
{
QString str1 = QString::fromLatin1( "ftp://ftp.de.kde.org" );
QString str2 = QString::fromLatin1( "ftp://ftp.de.kde.org/" );
#ifndef KDE_NO_DEPRECATED
QVERIFY(!urlcmp(str1, str2));
QVERIFY(!urlcmp(str1, str2, KUrl::CompareWithoutTrailingSlash)); // empty path != '/'
QVERIFY(urlcmp(str1, str2, KUrl::CompareWithoutTrailingSlash|KUrl::AllowEmptyPath));
#endif
KUrl u1(str1);
KUrl u2(str2);
QVERIFY(!u1.equals(u2));
@ -1445,17 +1436,6 @@ void KUrlTest::testComparisons()
}
QString ucmp3 = "ftp://ftp.de.kde.org/dir/#";
#ifndef KDE_NO_DEPRECATED
QVERIFY( !urlcmp(ucmp2,ucmp3) ); // (only hash difference)
QVERIFY( urlcmp(ucmp2,ucmp3,KUrl::CompareWithoutFragment) ); // (only hash difference, ignore_ref)
QVERIFY( urlcmp(ucmp2,ucmp3,KUrl::CompareWithoutTrailingSlash | KUrl::CompareWithoutFragment) ); // (slash and hash difference, ignore_trailing, ignore_ref)
QVERIFY( urlcmp("","",KUrl::CompareWithoutFragment) ); // (empty, empty)
QVERIFY( urlcmp("","") ); // (empty, empty)
QVERIFY( !urlcmp("",ucmp1) ); // (empty, not empty)
QVERIFY( !urlcmp("",ucmp1,KUrl::CompareWithoutFragment) ); // (empty, not empty)
QVERIFY( !urlcmp("file",ucmp1) ); // (malformed, not empty)
QVERIFY( !urlcmp("file",ucmp1,KUrl::CompareWithoutFragment) ); // (malformed, not empty)
#endif
KUrl ftpUrl( "ftp://ftp.de.kde.org" );
QCOMPARE( ftpUrl.path(), QString());

View file

@ -1,362 +0,0 @@
/* This file is part of the KDE project
* Copyright (C) 2001 Simon Hausmann <hausmann@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef kgenericfactory_h
#define kgenericfactory_h
#include <klibloader.h>
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <ktypelist.h>
#include <kcomponentdata.h>
#include <kgenericfactory.tcc>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
#ifndef KDE_NO_DEPRECATED
/* @internal */
template <class T>
class KGenericFactoryBase : public KPluginFactory
{
public:
explicit KGenericFactoryBase(const char *componentName, const char *catalogName)
: KPluginFactory(componentName, catalogName)
{
s_self = this;
s_createComponentDataCalled = false;
}
explicit KGenericFactoryBase( const KAboutData *data )
: KPluginFactory(data)
{
s_self = this;
s_createComponentDataCalled = false;
}
virtual ~KGenericFactoryBase()
{
s_self = 0;
}
static KComponentData componentData()
{
Q_ASSERT(s_self);
if (!s_createComponentDataCalled) {
s_createComponentDataCalled = true;
KComponentData *kcd = s_self->createComponentData();
Q_ASSERT(kcd);
s_self->setComponentData(*kcd);
delete kcd;
}
return static_cast<KPluginFactory *>(s_self)->componentData();
}
protected:
virtual KComponentData *createComponentData()
{
return new KComponentData(componentData());
}
private:
static bool s_createComponentDataCalled;
static KGenericFactoryBase<T> *s_self;
};
/* @internal */
template <class T>
KGenericFactoryBase<T> *KGenericFactoryBase<T>::s_self = 0;
/* @internal */
template <class T>
bool KGenericFactoryBase<T>::s_createComponentDataCalled = false;
/**
* This template provides a generic implementation of a KLibFactory ,
* for use with shared library components. It implements the pure virtual
* createObject method of KLibFactory and instantiates objects of the
* specified class (template argument) when the class name argument of
* createObject matches a class name in the given hierarchy.
*
* In case you are developing a KParts component, skip this file and
* go directly to KParts::GenericFactory .
*
* Note that the class specified as template argument needs to provide
* a certain constructor:
* <ul>
* <li>If the class is derived from QObject then it needs to have
* a constructor like:
* <code>MyClass( QObject *parent,
* const QStringList &args );</code>
* <li>If the class is derived from QWidget then it needs to have
* a constructor like:
* <code>MyWidget( QWidget *parent,
* const QStringList &args);</code>
* <li>If the class is derived from KParts::Part then it needs to have
* a constructor like:
* <code>MyPart( QWidget *parentWidget,
* QObject *parent,
* const QStringList &args );</code>
* </ul>
* The args QStringList passed to the constructor is the args string list
* that the caller passed to KLibFactory's create method.
*
* In addition upon instantiation this template provides a central
* KComponentData object for your component, accessible through the
* static componentData() method. The componentName and catalogName arguments
* of the KGenericFactory constructor are passed to the KComponentData object.
*
* The creation of the KComponentData object can be customized by inheriting
* from this template class and re-implementing the virtual createComponentData
* method. For example it could look like this:
* \code
* KComponentData *MyFactory::createComponentData()
* {
* return new KComponentData( myAboutData );
* }
* \endcode
*
* Example of usage of the whole template:
* \code
* class MyPlugin : public KParts::Plugin
* {
* Q_ OBJECT
* public:
* MyPlugin( QObject *parent, const QStringList &args );
* ...
* };
*
* K_EXPORT_COMPONENT_FACTORY( libmyplugin, KGenericFactory<MyPlugin> )
* \endcode
*
* @deprecated use KPluginFactory
*/
template <class Product, class ParentType = QObject>
class KDE_DEPRECATED KGenericFactory : public KGenericFactoryBase<Product>
{
public:
explicit KGenericFactory( const char *componentName = 0, const char *catalogName = 0 )
: KGenericFactoryBase<Product>(componentName, catalogName)
{}
explicit KGenericFactory( const KAboutData *data )
: KGenericFactoryBase<Product>(data)
{}
protected:
virtual QObject *createObject( QObject *parent,
const char *className, const QStringList &args )
{
return KDEPrivate::ConcreteFactory<Product, ParentType>
::create( 0, parent, className, args );
}
};
/**
* \class KGenericFactory kgenericfactory.h <KGenericFactory>
*
* This template provides a generic implementation of a KLibFactory ,
* for use with shared library components. It implements the pure virtual
* createObject method of KLibFactory and instantiates objects of the
* specified classes in the given typelist template argument when the class
* name argument of createObject matches a class names in the given hierarchy
* of classes.
*
* Note that each class in the specified in the typelist template argument
* needs to provide a certain constructor:
* <ul>
* <li>If the class is derived from QObject then it needs to have
* a constructor like:
* <code>MyClass( QObject *parent,
* const QStringList &args );</code>
* <li>If the class is derived from QWidget then it needs to have
* a constructor like:
* <code>MyWidget( QWidget *parent,
* const QStringList &args);</code>
* <li>If the class is derived from KParts::Part then it needs to have
* a constructor like:
* <code>MyPart( QWidget *parentWidget,
* QObject *parent,
* const QStringList &args );</code>
* </ul>
* The args QStringList passed to the constructor is the args string list
* that the caller passed to KLibFactory's create method.
*
* In addition upon instantiation this template provides a central
* KComponentData object for your component, accessible through the
* static componentData() method. The componentName and catalogName arguments
* of the KGenericFactory constructor are passed to the KComponentData object.
*
* The creation of the KComponentData object can be customized by inheriting
* from this template class and re-implementing the virtual createComponentData
* method. For example it could look like this:
* \code
* KComponentData *MyFactory::createComponentData()
* {
* return new KComponentData( myAboutData );
* }
* \endcode
*
* Example of usage of the whole template:
* \code
* class MyPlugin : public KParts::Plugin
* {
* Q_ OBJECT
* public:
* MyPlugin( QObject *parent,
* const QStringList &args );
* ...
* };
*
* class MyDialogComponent : public KDialog
* {
* Q_ OBJECT
* public:
* MyDialogComponent( QWidget *parentWidget,
* const QStringList &args );
* ...
* };
*
* typedef K_TYPELIST_2( MyPlugin, MyDialogComponent ) Products;
* K_EXPORT_COMPONENT_FACTORY( libmyplugin, KGenericFactory<Products> )
* \endcode
*/
template <class Product, class ProductListTail>
class KGenericFactory< KTypeList<Product, ProductListTail>, QObject >
: public KGenericFactoryBase<KTypeList<Product, ProductListTail> >
{
public:
explicit KGenericFactory( const char *componentName = 0, const char *catalogName = 0 )
: KGenericFactoryBase<KTypeList<Product, ProductListTail> >(componentName, catalogName)
{}
explicit KGenericFactory( const KAboutData *data )
: KGenericFactoryBase<KTypeList<Product, ProductListTail> >(data)
{}
protected:
virtual QObject *createObject( QObject *parent,
const char *className, const QStringList &args )
{
return KDEPrivate::MultiFactory< KTypeList< Product, ProductListTail > >
::create( 0, parent, className, args );
}
};
/**
* \class KGenericFactory kgenericfactory.h <KGenericFactory>
*
* This template provides a generic implementation of a KLibFactory ,
* for use with shared library components. It implements the pure virtual
* createObject method of KLibFactory and instantiates objects of the
* specified classes in the given typelist template argument when the class
* name argument of createObject matches a class names in the given hierarchy
* of classes.
*
* Note that each class in the specified in the typelist template argument
* needs to provide a certain constructor:
* <ul>
* <li>If the class is derived from QObject then it needs to have
* a constructor like:
* <code>MyClass( QObject *parent,
* const QStringList &args );</code>
* <li>If the class is derived from QWidget then it needs to have
* a constructor like:
* <code>MyWidget( QWidget *parent,
* const QStringList &args);</code>
* <li>If the class is derived from KParts::Part then it needs to have
* a constructor like:
* <code>MyPart( QWidget *parentWidget,
* QObject *parent,
* const QStringList &args );</code>
* </ul>
* The args QStringList passed to the constructor is the args string list
* that the caller passed to KLibFactory's create method.
*
* In addition upon instantiation this template provides a central
* KComponentData object for your component, accessible through the
* static componentData() method. The componentName and catalogNames arguments
* of the KGenericFactory constructor are passed to the KComponentData object.
*
* The creation of the KComponentData object can be customized by inheriting
* from this template class and re-implementing the virtual createComponentData
* method. For example it could look like this:
* \code
* KComponentData *MyFactory::createComponentData()
* {
* return new KComponentData( myAboutData );
* }
* \endcode
*
* Example of usage of the whole template:
* \code
* class MyPlugin : public KParts::Plugin
* {
* Q_ OBJECT
* public:
* MyPlugin( QObject *parent,
* const QStringList &args );
* ...
* };
*
* class MyDialogComponent : public KDialog
* {
* Q_ OBJECT
* public:
* MyDialogComponent( QWidget *parentWidget,
* const QStringList &args );
* ...
* };
*
* typedef K_TYPELIST_2( MyPlugin, MyDialogComponent ) Products;
* K_EXPORT_COMPONENT_FACTORY( libmyplugin, KGenericFactory<Products> )
* \endcode
*/
template <class Product, class ProductListTail,
class ParentType, class ParentTypeListTail>
class KGenericFactory< KTypeList<Product, ProductListTail>,
KTypeList<ParentType, ParentTypeListTail> >
: public KGenericFactoryBase<KTypeList<Product, ProductListTail> >
{
public:
explicit KGenericFactory( const char *componentName = 0, const char *catalogName = 0 )
: KGenericFactoryBase<KTypeList<Product, ProductListTail> >(componentName, catalogName)
{}
explicit KGenericFactory( const KAboutData *data )
: KGenericFactoryBase<KTypeList<Product, ProductListTail> >(data)
{}
protected:
virtual QObject *createObject( QObject *parent,
const char *className, const QStringList &args )
{
return KDEPrivate::MultiFactory< KTypeList< Product, ProductListTail >,
KTypeList< ParentType, ParentTypeListTail > >
::create( 0, 0, parent,
className, args );
}
};
#endif
#endif

View file

@ -30,269 +30,4 @@
#include "kpluginloader.h"
#include "klibrary.h"
#ifndef KDE_NO_DEPRECATED
# define K_EXPORT_COMPONENT_FACTORY( libname, factory ) \
extern "C" { KDE_EXPORT KPluginFactory *init_##libname() { return new factory; } }
/**
* \class KLibLoader klibloader.h <KLibLoader>
*
* The KLibLoader allows you to load libraries dynamically at runtime.
* Dependent libraries are loaded automatically.
*
* KLibLoader follows the singleton pattern. You can not create multiple
* instances. Use self() to get a pointer to the loader.
*
* @deprecated You have two other possibilites:
* - KPluginLoader or KService::createInstance for plugins
* - KLibrary for other libraries
*
* @see KLibrary
* @see KPluginLoader
* @author Torben Weis <weis@kde.org>
*/
class KDECORE_EXPORT KLibLoader : public QObject //krazy:exclude=dpointer (private class is kept as a global static)
{
friend class KLibrary;
friend class KLibraryPrivate;
friend class KLibLoaderPrivate;
Q_OBJECT
public:
/**
* Loads and initializes a library. Loading a library multiple times is
* handled gracefully.
*
* This is a convenience function that returns the factory immediately
* @param libname This is the library name without extension. Usually that is something like
* "libkspread". The function will then search for a file named
* "libkspread.la" in the KDE library paths.
* The *.la files are created by libtool and contain
* important information especially about the libraries dependencies
* on other shared libs. Loading a "libfoo.so" could not solve the
* dependencies problem.
*
* You can, however, give a library name ending in ".so"
* (or whatever is used on your platform), and the library
* will be loaded without resolving dependencies. Use with caution.
* @param loadHint provides more control over how the library is loaded
* @return the KPluginFactory, or 0 if the library does not exist or it does
* not have a factory
* @see library
*/
KPluginFactory* factory( const QString &libname, QLibrary::LoadHints loadHint = 0);
/**
* Loads and initializes a library. Loading a library multiple times is
* handled gracefully.
*
* @param libname This is the library name without extension. Usually that is something like
* "libkspread". The function will then search for a file named
* "libkspread.la" in the KDE library paths.
* The *.la files are created by libtool and contain
* important information especially about the libraries dependencies
* on other shared libs. Loading a "libfoo.so" could not solve the
* dependencies problem.
*
* You can, however, give a library name ending in ".so"
* (or whatever is used on your platform), and the library
* will be loaded without resolving dependencies. Use with caution.
* @param loadHint provides more control over how the library is loaded
* @return KLibrary is invalid (0) when the library couldn't be dlopened. in such
* a case you can retrieve the error message by calling KLibLoader::lastErrorMessage()
*
* @see factory
*/
KLibrary* library( const QString &libname, QLibrary::LoadHints loadHint = 0 );
/**
* Returns an error message that can be useful to debug the problem.
* Returns QString() if the last call to library() was successful.
* You can call this function more than once. The error message is only
* reset by a new call to library().
* @return the last error message, or QString() if there was no error
*/
QString lastErrorMessage() const;
/**
* Unloads the library with the given name.
* @param libname This is the library name without extension. Usually that is something like
* "libkspread". The function will then search for a file named
* "libkspread.la" in the KDE library paths.
* The *.la files are created by libtool and contain
* important information especially about the libraries dependencies
* on other shared libs. Loading a "libfoo.so" could not solve the
* dependencies problem.
*
* You can, however, give a library name ending in ".so"
* (or whatever is used on your platform), and the library
* will be loaded without resolving dependencies. Use with caution.
*/
void unloadLibrary( const QString &libname );
/**
* Returns a pointer to the factory.
*
* Use this function to get an instance of KLibLoader.
*
* @return a pointer to the loader. If no loader exists until now
* then one is created.
*
* @deprecated use KPluginLoader instead
*/
static KDE_DEPRECATED KLibLoader* self();
/**
* Helper method which looks for a library in the standard paths
* ("module" and "lib" resources).
* Made public for code that doesn't use KLibLoader itself, but still
* wants to open modules.
* @param libname of the library. If it is not a path, the function searches in
* the "module" and "lib" resources. If there is no extension,
* ".la" will be appended.
* @param cData a KComponentData used to get the standard paths
* @return the name of the library if it was found, an empty string otherwise
*/
static QString findLibrary(const QString &libname, const KComponentData &cData = KGlobal::mainComponent());
/**
* This enum type defines the possible error cases that can happen
* when loading a component.
*
* Use errorString() to convert the error code to a human-readable string
*/
enum ComponentLoadingError {
ErrNoLibrary = 1, /*< the specified library could not be loaded. Use KLibLoader::lastErrorMessage for details*/
ErrNoFactory, /*< the library does not export a factory */
ErrNoComponent, /*< the factory does not support creating components of the specified type */
ErrServiceProvidesNoLibrary, /*< the specified service provides no shared library (when using KService) */
ErrNoServiceFound /*< no service implementing the given servicetype and fullfilling the given constraint expression can be found (when using KServiceTypeTrader) */
};
/**
* Converts a numerical error code into a human-readable error message
*
* @param componentLoadingError the error code, as set using the @p error
* parameter of createInstance()
* @return the translated error message describing the error represented
* by @p componentLoadingError
*
* @see ComponentLoadingError
*/
static QString errorString( int componentLoadingError );
/**
* This template allows to load the specified library and ask the
* factory to create an instance of the given template type.
*
* @param keyword the keyword for the plugin - see KPluginFactory::registerPlugin()
* @param libname the library to open
* @param parent the parent object (see QObject constructor)
* @param args a list of string arguments, passed to the factory and possibly
* to the component (see KPluginFactory)
* @param error if not null, the int will be set to 0 on success or one of the
* error codes defined by ComponentLoadingError if there was an error
* @return a pointer to the newly created object or a null pointer if the
* factory was unable to create an object of the given type
* @deprecated Use KService::createInstance() or KPluginLoader instead
*/
template <typename T>
static KDE_DEPRECATED T *createInstance(const QString &keyword, const QString &libname, QObject *parent = 0,
const QVariantList &args = QVariantList(),
int *error = 0 )
{
KLibrary *library = KLibLoader::self()->library( libname );
if ( !library )
{
if ( error )
*error = ErrNoLibrary;
return 0;
}
KPluginFactory *factory = library->factory();
if ( !factory )
{
library->unload();
if ( error )
*error = ErrNoFactory;
return 0;
}
QObject *object = factory->template create<T>(keyword, parent, args);
T *res = qobject_cast<T *>( object );
if ( !res )
{
delete object;
library->unload();
if ( error )
*error = ErrNoComponent;
}
return res;
}
/**
* This template allows to load the specified library and ask the
* factory to create an instance of the given template type.
*
* @param libname the library to open
* @param parent the parent object (see QObject constructor)
* @param args a list of string arguments, passed to the factory and possibly
* to the component (see KPluginFactory)
* @param error if not null, the int will be set to 0 on success or one of the
* error codes defined by ComponentLoadingError if there was an error
* @return a pointer to the newly created object or a null pointer if the
* factory was unable to create an object of the given type
* @deprecated Use KService::createInstance() or KPluginLoader instead
*/
template <typename T>
static KDE_DEPRECATED T *createInstance( const QString &libname, QObject *parent = 0,
const QVariantList &args = QVariantList(),
int *error = 0 )
{
return createInstance<T>(QString(), libname, parent, args, error);
}
/**
* @deprecated Use one of the other createInstance methods or
* KPluginLoader or KService::createInstance instead
*/
template <typename T>
static KDE_DEPRECATED T *createInstance( const QString &libname, QObject *parent,
const QStringList &args,
int *error = 0 )
{
KLibrary *library = KLibLoader::self()->library( libname );
if ( !library )
{
if ( error )
*error = ErrNoLibrary;
return 0;
}
KPluginFactory *factory = library->factory();
if ( !factory )
{
library->unload();
if ( error )
*error = ErrNoFactory;
return 0;
}
QObject *object = factory->template create<T>(parent, args);
T *res = qobject_cast<T *>( object );
if ( !res )
{
delete object;
library->unload();
if ( error )
*error = ErrNoComponent;
}
return res;
}
private:
~KLibLoader();
KLibLoader();
};
#endif
#endif

View file

@ -42,17 +42,6 @@ KPluginFactory::KPluginFactory(const char *componentName, const char *catalogNam
factorycleanup->add(this);
}
#ifndef KDE_NO_DEPRECATED
KPluginFactory::KPluginFactory(const KAboutData *aboutData, QObject *parent)
: QObject(parent), d_ptr(new KPluginFactoryPrivate)
{
Q_D(KPluginFactory);
d->q_ptr = this;
d->componentData = KComponentData(*aboutData);
factorycleanup->add(this);
}
#endif
KPluginFactory::KPluginFactory(const KAboutData &aboutData, QObject *parent)
: QObject(parent), d_ptr(new KPluginFactoryPrivate)
@ -64,15 +53,6 @@ KPluginFactory::KPluginFactory(const KAboutData &aboutData, QObject *parent)
factorycleanup->add(this);
}
#ifndef KDE_NO_DEPRECATED
KPluginFactory::KPluginFactory(QObject *parent)
: QObject(parent), d_ptr(new KPluginFactoryPrivate())
{
Q_D(KPluginFactory);
d->q_ptr = this;
factorycleanup->add(this);
}
#endif
KPluginFactory::KPluginFactory(KPluginFactoryPrivate &d, QObject *parent)
: QObject(parent), d_ptr(&d)
@ -137,26 +117,7 @@ void KPluginFactory::registerPlugin(const QString &keyword, const QMetaObject *m
}
}
#ifndef KDE_NO_DEPRECATED
QObject *KPluginFactory::createObject(QObject *parent, const char *className, const QStringList &args)
{
Q_UNUSED(parent);
Q_UNUSED(className);
Q_UNUSED(args);
return 0;
}
#endif
#ifndef KDE_NO_DEPRECATED
KParts::Part *KPluginFactory::createPartObject(QWidget *parentWidget, QObject *parent, const char *classname, const QStringList &args)
{
Q_UNUSED(parent);
Q_UNUSED(parentWidget);
Q_UNUSED(classname);
Q_UNUSED(args);
return 0;
}
#endif
QObject *KPluginFactory::create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args, const QString &keyword)
{
@ -169,27 +130,6 @@ QObject *KPluginFactory::create(const char *iface, QWidget *parentWidget, QObjec
setupTranslations();
}
#ifndef KDE_NO_DEPRECATED
if (keyword.isEmpty()) {
// kde3-kparts compatibility, remove in kde5
const char* kpartsIface = iface;
if (args.contains(QVariant(QString::fromLatin1("Browser/View"))))
kpartsIface = "Browser/View";
const QStringList argsStringList = variantListToStringList(args);
if ((obj = reinterpret_cast<QObject *>(createPartObject(parentWidget, parent, kpartsIface, argsStringList)))) {
objectCreated(obj);
return obj;
}
if ((obj = createObject(parent, iface, argsStringList))) {
objectCreated(obj);
return obj;
}
}
#endif
const QList<KPluginFactoryPrivate::Plugin> candidates(d->createInstanceHash.values(keyword));
// for !keyword.isEmpty() candidates.count() is 0 or 1

View file

@ -256,19 +256,6 @@ public:
* \param parent a parent object
*/
explicit KPluginFactory(const KAboutData &aboutData, QObject *parent = 0);
/**
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_CONSTRUCTOR_DEPRECATED explicit KPluginFactory(const KAboutData *aboutData, QObject *parent = 0);
#endif
/**
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
explicit KDE_CONSTRUCTOR_DEPRECATED KPluginFactory(QObject *parent);
#endif
/**
* This destroys the PluginFactory. It will remove the translation catalog for the plugin,
@ -337,24 +324,10 @@ public:
/**
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
template<typename T>
KDE_DEPRECATED
T *create(QObject *parent, const QStringList &args)
{
return create<T>(parent, stringListToVariantList(args));
}
#endif
/**
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QObject *create(QObject *parent = 0, const char *classname = "QObject", const QStringList &args = QStringList())
{
return create(classname, 0, parent, stringListToVariantList(args), QString());
}
#endif
Q_SIGNALS:
void objectCreated(QObject *object);
@ -424,16 +397,10 @@ protected:
/**
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
virtual KDE_DEPRECATED QObject *createObject(QObject *parent, const char *className, const QStringList &args);
#endif
/**
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
virtual KDE_DEPRECATED KParts::Part *createPartObject(QWidget *parentWidget, QObject *parent, const char *classname, const QStringList &args);
#endif
/**

View file

@ -186,14 +186,6 @@ KPluginFactory *KPluginLoader::factory()
if (!load())
return 0;
#ifndef KDE_NO_DEPRECATED
if (d->lib) {
// Calling a deprecated method, but this is the only way to
// support both new and old-style factories for now.
// KDE5: remove the whole if().
return d->lib->factory(d->name.toUtf8());
}
#endif
QObject *obj = instance();

View file

@ -116,13 +116,6 @@ public:
*/
const T& value() const { return this->second; }
/**
* @return the first value (the key)
* @deprecated use key()
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED Key index() const { return this->first; }
#endif
/**
* @return the first value.
*/

View file

@ -167,9 +167,6 @@ public:
* @return the full name of the user or QString() if user is invalid
* @deprecated use property(KUser::FullName) instead
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QString fullName() const;
#endif
/**
* The path to the user's home directory.

View file

@ -145,11 +145,6 @@ QString KUser::loginName() const {
return d->loginName;
}
#ifndef KDE_NO_DEPRECATED
QString KUser::fullName() const {
return d->properties[FullName].toString();
}
#endif
QString KUser::homeDir() const {
return d->homeDir;

View file

@ -40,11 +40,7 @@
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#ifndef KDE_NO_DEPRECATED
#include <klibloader.h>
#else
#include <klibrary.h>
#endif
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
@ -391,15 +387,6 @@ KDEDModule *Kded::loadModule(const KService::Ptr& s, bool onDemand)
if (factoryName.isEmpty())
factoryName = s->library();
factoryName = "create_" + factoryName;
#ifndef KDE_NO_DEPRECATED
KLibrary* lib = KLibLoader::self()->library(libname);
KDEDModule* (*create)();
if (lib) {
create = (KDEDModule* (*)())lib->resolveFunction(QFile::encodeName(factoryName));
if (create)
module = create();
}
#endif
if (!module) {
kWarning() << "Could not load library" << libname << ". ["
<< loader.errorString() << "]";

View file

@ -283,28 +283,12 @@ void KAction::setGlobalShortcut( const KShortcut & shortcut, ShortcutTypes type,
}
}
#ifndef KDE_NO_DEPRECATED
bool KAction::globalShortcutAllowed() const
{
return d->globalShortcutEnabled;
}
#endif
bool KAction::isGlobalShortcutEnabled() const
{
return d->globalShortcutEnabled;
}
#ifndef KDE_NO_DEPRECATED
void KAction::setGlobalShortcutAllowed( bool allowed, GlobalShortcutLoading /* load */ )
{
if (allowed) {
//### no-op
} else {
forgetGlobalShortcut();
}
}
#endif
void KAction::forgetGlobalShortcut()
{

View file

@ -220,9 +220,6 @@ class KDEUI_EXPORT KAction : public QWidgetAction
Q_PROPERTY( KShortcut shortcut READ shortcut WRITE setShortcut )
Q_PROPERTY( bool shortcutConfigurable READ isShortcutConfigurable WRITE setShortcutConfigurable )
Q_PROPERTY( KShortcut globalShortcut READ globalShortcut WRITE setGlobalShortcut )
#ifndef KDE_NO_DEPRECATED
Q_PROPERTY( bool globalShortcutAllowed READ globalShortcutAllowed WRITE setGlobalShortcutAllowed )
#endif
Q_PROPERTY( bool globalShortcutEnabled READ isGlobalShortcutEnabled )
Q_FLAGS( ShortcutType )
@ -427,21 +424,6 @@ public:
* Defaults to false.
* Use isGlobalShortcutEnabled() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool globalShortcutAllowed() const;
#endif
/**
* Indicate whether the programmer and/or user may define a global shortcut for this action.
* Defaults to false. Note that calling setGlobalShortcut() turns this on automatically.
*
* \param allowed set to \e true if this action may have a global shortcut, otherwise \e false.
* \param loading if Autoloading, assign to this action the global shortcut it has previously had
* if any.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setGlobalShortcutAllowed(bool allowed, GlobalShortcutLoading loading = Autoloading);
#endif
/**
* Returns true if this action is enabled to have a global shortcut.

View file

@ -104,13 +104,6 @@ QWidget * KActionMenu::createWidget( QWidget * _parent )
return button;
}
#ifndef KDE_NO_DEPRECATED
void KActionMenu::remove( KAction* cmd )
{
if ( cmd )
menu()->removeAction(cmd);
}
#endif
void KActionMenu::addAction( QAction * action )
{

View file

@ -56,28 +56,12 @@ public:
KActionMenu(const KIcon& icon, const QString& text, QObject *parent);
virtual ~KActionMenu();
/**
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void remove( KAction* );
#endif
void addAction(QAction* action);
QAction* addSeparator();
void insertAction(QAction* before, QAction* action);
QAction* insertSeparator(QAction* before);
void removeAction(QAction* action);
/**
* Returns this action's menu as a KMenu, if it is one.
* If none exists, one will be created.
* @deprecated use menu() instead.
*/
#ifndef KDE_NO_DEPRECATED
inline KDE_DEPRECATED KMenu* popupMenu() { return menu(); }
#endif
/**
* Returns this action's menu as a KMenu, if it is one.
* If none exists, one will be created.

View file

@ -188,11 +188,6 @@ namespace KStandardAction
*/
KDEUI_EXPORT const char* name( StandardAction id );
/// @deprecated use name()
#ifndef KDE_NO_DEPRECATED
inline KDE_DEPRECATED const char* stdName(StandardAction act_enum) { return name( act_enum ); }
#endif
/**
* Returns a list of all standard names. Used by KAccelManager
* to give those heigher weight.

View file

@ -60,12 +60,6 @@ KToolBarPopupAction::~KToolBarPopupAction()
delete menu();
}
#ifndef KDE_NO_DEPRECATED
KMenu* KToolBarPopupAction::popupMenu() const
{
return qobject_cast<KMenu*>( menu() );
}
#endif
QWidget * KToolBarPopupAction::createWidget( QWidget * _parent )
{

View file

@ -69,17 +69,6 @@ class KDEUI_EXPORT KToolBarPopupAction : public KAction
*/
virtual ~KToolBarPopupAction();
/**
* The popup menu that is shown when clicking (some time) on the toolbar
* button. You may want to plug items into it on creation, or connect to
* aboutToShow for a more dynamic menu.
*
* \deprecated use menu() instead
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED KMenu *popupMenu() const;
#endif
/**
* Returns true if this action creates a delayed popup menu
* when plugged in a KToolBar.

View file

@ -173,12 +173,6 @@ void KShortcutsEditor::clearConfiguration()
}
#ifndef KDE_NO_DEPRECATED
void KShortcutsEditor::importConfiguration( KConfig *config)
{
d->importConfiguration(config);
}
#endif
void KShortcutsEditor::importConfiguration( KConfigBase *config)
@ -187,12 +181,6 @@ void KShortcutsEditor::importConfiguration( KConfigBase *config)
}
#ifndef KDE_NO_DEPRECATED
void KShortcutsEditor::exportConfiguration( KConfig *config) const
{
exportConfiguration(static_cast<KConfigBase*>(config));
}
#endif
void KShortcutsEditor::exportConfiguration( KConfigBase *config) const

View file

@ -184,9 +184,6 @@ public:
*
* @param config Config object
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void exportConfiguration( KConfig *config) const;
#endif
void exportConfiguration( KConfigBase *config) const;
/**
@ -197,9 +194,6 @@ public:
*
* @param config Config object
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void importConfiguration( KConfig *config);
#endif
void importConfiguration( KConfigBase *config);

View file

@ -1497,23 +1497,6 @@ bool KIconLoader::alphaBlending(KIconLoader::Group group) const
return d->mpGroups[group].alphaBlending;
}
// deprecated
#ifndef KDE_NO_DEPRECATED
QIcon KIconLoader::loadIconSet( const QString& name, KIconLoader::Group g, int s,
bool canReturnNull )
{
QIcon iconset;
QPixmap tmp = loadIcon(name, g, s, KIconLoader::ActiveState, QStringList(), NULL, canReturnNull);
iconset.addPixmap( tmp, QIcon::Active, QIcon::On );
// we don't use QIconSet's resizing anyway
tmp = loadIcon(name, g, s, KIconLoader::DisabledState, QStringList(), NULL, canReturnNull);
iconset.addPixmap( tmp, QIcon::Disabled, QIcon::On );
tmp = loadIcon(name, g, s, KIconLoader::DefaultState, QStringList(), NULL, canReturnNull);
iconset.addPixmap( tmp, QIcon::Normal, QIcon::On );
return iconset;
}
#endif
// Easy access functions
QPixmap DesktopIcon(const QString& name, int force_size, int state, const QStringList &overlays)
@ -1522,75 +1505,30 @@ QPixmap DesktopIcon(const QString& name, int force_size, int state, const QStrin
return loader->loadIcon(name, KIconLoader::Desktop, force_size, state, overlays);
}
// deprecated
#ifndef KDE_NO_DEPRECATED
QIcon DesktopIconSet(const QString& name, int force_size)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIconSet(name, KIconLoader::Desktop, force_size);
}
#endif
QPixmap BarIcon(const QString& name, int force_size, int state, const QStringList &overlays)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIcon(name, KIconLoader::Toolbar, force_size, state, overlays);
}
// deprecated
#ifndef KDE_NO_DEPRECATED
QIcon BarIconSet(const QString& name, int force_size)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIconSet( name, KIconLoader::Toolbar, force_size );
}
#endif
QPixmap SmallIcon(const QString& name, int force_size, int state, const QStringList &overlays)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIcon(name, KIconLoader::Small, force_size, state, overlays);
}
// deprecated
#ifndef KDE_NO_DEPRECATED
QIcon SmallIconSet(const QString& name, int force_size)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIconSet( name, KIconLoader::Small, force_size );
}
#endif
QPixmap MainBarIcon(const QString& name, int force_size, int state, const QStringList &overlays)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIcon(name, KIconLoader::MainToolbar, force_size, state, overlays);
}
// deprecated
#ifndef KDE_NO_DEPRECATED
QIcon MainBarIconSet(const QString& name, int force_size)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIconSet( name, KIconLoader::MainToolbar, force_size );
}
#endif
QPixmap UserIcon(const QString& name, int state, const QStringList &overlays)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIcon(name, KIconLoader::User, 0, state, overlays);
}
// deprecated
#ifndef KDE_NO_DEPRECATED
QIcon UserIconSet(const QString& name)
{
KIconLoader *loader = KIconLoader::global();
return loader->loadIconSet( name, KIconLoader::User );
}
#endif
int IconSize(KIconLoader::Group group)
{
KIconLoader *loader = KIconLoader::global();

View file

@ -93,7 +93,6 @@ public:
Action, ///< An action icon (e.g. 'save', 'print').
Application, ///< An icon that represents an application.
Device, ///< An icon that represents a device.
FileSystem, ///< An icon that represents a file system. @deprecated Use Place instead.
MimeType, ///< An icon that represents a mime type (or file type).
Animation, ///< An icon that is animated.
Category, ///< An icon that represents a category.
@ -274,28 +273,6 @@ public:
int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList(),
QString *path_store=0 ) const;
/**
* Creates an icon set, that will do on-demand loading of the icon.
* Loading itself is done by calling loadIcon .
*
* @param name The name of the icon, without extension.
* @param group The icon group. This will specify the size of and effects to
* be applied to the icon.
* @param size If nonzero, this overrides the size specified by @p group.
* See KIconLoader::StdSizes.
* @param canReturnNull Can return a null iconset? If false, iconset
* containing the "unknown" pixmap is returned when no appropriate icon has
* been found.
* @return the icon set. Can be null when not found, depending on
* @p canReturnNull.
*
* @deprecated use KIcon instead, which uses the iconloader internally
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QIcon loadIconSet(const QString& name, KIconLoader::Group group, int size = 0,
bool canReturnNull = false);
#endif
/**
* Returns the path of an icon.
* @param name The name of the icon, without extension. If an absolute
@ -482,15 +459,6 @@ Q_SIGNALS:
KDEUI_EXPORT QPixmap DesktopIcon(const QString& name, int size=0,
int state=KIconLoader::DefaultState, const QStringList& overlays = QStringList());
/**
* \relates KIconLoader
* Load a desktop icon, and apply the necessary effects to get an IconSet.
* @deprecated use KIcon(name) or KIcon(name,componentData.iconLoader()) instead
*/
#ifndef KDE_NO_DEPRECATED
KDEUI_EXPORT_DEPRECATED QIcon DesktopIconSet(const QString& name, int size=0);
#endif
/**
* \relates KIconLoader
* Load a toolbar icon.
@ -498,15 +466,6 @@ KDEUI_EXPORT_DEPRECATED QIcon DesktopIconSet(const QString& name, int size=0);
KDEUI_EXPORT QPixmap BarIcon(const QString& name, int size=0, int state=KIconLoader::DefaultState,
const QStringList& overlays = QStringList());
/**
* \relates KIconLoader
* Load a toolbar icon, and apply the necessary effects to get an IconSet.
* @deprecated use KIcon(name) or KIcon(name,componentData.iconLoader()) instead
*/
#ifndef KDE_NO_DEPRECATED
KDEUI_EXPORT_DEPRECATED QIcon BarIconSet(const QString& name, int size=0);
#endif
/**
* \relates KIconLoader
* Load a small icon.
@ -514,15 +473,6 @@ KDEUI_EXPORT_DEPRECATED QIcon BarIconSet(const QString& name, int size=0);
KDEUI_EXPORT QPixmap SmallIcon(const QString& name, int size=0,
int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
/**
* \relates KIconLoader
* Load a small icon, and apply the necessary effects to get an IconSet.
* @deprecated use KIcon(name) or KIcon(name,componentData.iconLoader()) instead
*/
#ifndef KDE_NO_DEPRECATED
KDEUI_EXPORT_DEPRECATED QIcon SmallIconSet(const QString& name, int size=0);
#endif
/**
* \relates KIconLoader
* Load a main toolbar icon.
@ -530,30 +480,12 @@ KDEUI_EXPORT_DEPRECATED QIcon SmallIconSet(const QString& name, int size=0);
KDEUI_EXPORT QPixmap MainBarIcon(const QString& name, int size=0,
int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
/**
* \relates KIconLoader
* Load a main toolbar icon, and apply the effects to get an IconSet.
* @deprecated use KIcon(name) or KIcon(name,componentData.iconLoader()) instead
*/
#ifndef KDE_NO_DEPRECATED
KDEUI_EXPORT_DEPRECATED QIcon MainBarIconSet(const QString& name, int size=0);
#endif
/**
* \relates KIconLoader
* Load a user icon. User icons are searched in $appdir/pics.
*/
KDEUI_EXPORT QPixmap UserIcon(const QString& name, int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
/**
* \relates KIconLoader
* Load a user icon, and apply the effects to get an IconSet.
* @deprecated use KIcon(name) or KIcon(name,componentData.iconLoader()) instead
*/
#ifndef KDE_NO_DEPRECATED
KDEUI_EXPORT_DEPRECATED QIcon UserIconSet(const QString& name);
#endif
/**
* \relates KIconLoader
* Returns the current icon size for a specific group.

View file

@ -650,8 +650,6 @@ KIconThemeDir::KIconThemeDir(const QString& basedir, const QString &themedir, co
mContext = KIconLoader::Device;
else if (tmp == "MimeTypes")
mContext = KIconLoader::MimeType;
else if (tmp == "FileSystems")
mContext = KIconLoader::FileSystem;
else if (tmp == "Applications")
mContext = KIconLoader::Application;
else if (tmp == "Actions")

View file

@ -94,13 +94,6 @@ bool KCategorizedSortFilterProxyModel::sortCategoriesByNaturalComparison() const
return d->sortCategoriesByNaturalComparison;
}
#ifndef KDE_NO_DEPRECATED
int KCategorizedSortFilterProxyModel::naturalCompare(const QString &a,
const QString &b)
{
return KStringHandler::naturalCompare(a, b);
}
#endif
bool KCategorizedSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
{

View file

@ -111,9 +111,6 @@ public:
* @deprecated
* Use KStringHandler::naturalCompare() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED static int naturalCompare(const QString &a, const QString &b);
#endif
protected:
/**

View file

@ -1497,27 +1497,7 @@ void KCategorizedView::rowsInserted(const QModelIndex &parent,
d->rowsInserted(parent, start, end);
}
#ifndef KDE_NO_DEPRECATED
void KCategorizedView::rowsInsertedArtifficial(const QModelIndex &parent,
int start,
int end)
{
Q_UNUSED(parent);
Q_UNUSED(start);
Q_UNUSED(end);
}
#endif
#ifndef KDE_NO_DEPRECATED
void KCategorizedView::rowsRemoved(const QModelIndex &parent,
int start,
int end)
{
Q_UNUSED(parent);
Q_UNUSED(start);
Q_UNUSED(end);
}
#endif
void KCategorizedView::slotLayoutChanged()
{

View file

@ -308,26 +308,6 @@ protected:
int end);
protected Q_SLOTS:
/**
* @internal
* @warning Deprecated since 4.4.
*/
#ifndef KDE_NO_DEPRECATED
virtual KDE_DEPRECATED void rowsInsertedArtifficial(const QModelIndex &parent,
int start,
int end);
#endif
/**
* @internal
* @warning Deprecated since 4.4.
*/
#ifndef KDE_NO_DEPRECATED
virtual KDE_DEPRECATED void rowsRemoved(const QModelIndex &parent,
int start,
int end);
#endif
/**
* @internal
* Reposition items as needed.

View file

@ -222,15 +222,6 @@ QPersistentModelIndex KWidgetItemDelegate::focusedIndex() const
return d->itemView->indexAt(pos);
}
#ifndef KDE_NO_DEPRECATED
void KWidgetItemDelegate::paintWidgets(QPainter *painter, const QStyleOptionViewItem &option,
const QPersistentModelIndex &index) const
{
Q_UNUSED(painter);
Q_UNUSED(option);
Q_UNUSED(index);
}
#endif
//@cond PRIVATE
bool KWidgetItemDelegatePrivate::eventFilter(QObject *watched, QEvent *event)

View file

@ -128,10 +128,6 @@ protected:
* widgets of a certain index to be updated your model has to emit dataChanged() on the
* indexes that want to be updated.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void paintWidgets(QPainter *painter, const QStyleOptionViewItem &option,
const QPersistentModelIndex &index) const;
#endif
/**
* Sets the list of event @p types that a @p widget will block.

View file

@ -944,37 +944,6 @@ void KApplication::updateRemoteUserTimestamp( const QString& service, int time )
}
#ifndef KDE_NO_DEPRECATED
QString KApplication::tempSaveName( const QString& pFilename )
{
QString aFilename;
if( QDir::isRelativePath(pFilename) )
{
kWarning(240) << "Relative filename passed to KApplication::tempSaveName";
aFilename = QFileInfo( QDir( QLatin1String(".") ), pFilename ).absoluteFilePath();
}
else
aFilename = pFilename;
QDir aAutosaveDir( QDir::homePath() + QLatin1String("/autosave/") );
if( !aAutosaveDir.exists() )
{
if( !aAutosaveDir.mkdir( aAutosaveDir.absolutePath() ) )
{
// Last chance: use temp dir
aAutosaveDir.setPath( KGlobal::dirs()->saveLocation("tmp") );
}
}
aFilename.replace( '/', QLatin1String("\\!") )
.prepend( QLatin1Char('#') )
.append( QLatin1Char('#') )
.prepend( QLatin1Char('/') ).prepend( aAutosaveDir.absolutePath() );
return aFilename;
}
#endif
QString KApplication::checkRecoverFile( const QString& pFilename,

View file

@ -207,18 +207,6 @@ public:
**/
void setTopWidget( QWidget *topWidget );
/**
* Get a file name in order to make a temporary copy of your document.
*
* @param pFilename The full path to the current file of your
* document.
* @return A new filename for auto-saving.
* @deprecated use KTemporaryFile, KSaveFile or KAutoSaveFile instead
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED QString tempSaveName( const QString& pFilename );
#endif
/**
* Check whether an auto-save file exists for the document you want to
* open.

View file

@ -274,35 +274,6 @@ bool KGlobalSettings::showContextMenusOnPress ()
return g.readEntry("ShowOnPress", true);
}
#ifndef KDE_NO_DEPRECATED
int KGlobalSettings::contextMenuKey ()
{
KConfigGroup g(KGlobal::config(), "Shortcuts");
QString s = g.readEntry ("PopupMenuContext", "Menu");
// this is a bit of a code duplication with KShortcut,
// but seeing as that is all in kdeui these days there's little choice.
// this is faster for what we're really after here anyways
// (less allocations, only processing the first item always, etc)
if (s == QLatin1String("none")) {
return QKeySequence()[0];
}
const QStringList shortCuts = s.split(';');
if (shortCuts.count() < 1) {
return QKeySequence()[0];
}
s = shortCuts.at(0);
if ( s.startsWith( QLatin1String("default(") ) ) {
s = s.mid( 8, s.length() - 9 );
}
return QKeySequence::fromString(s)[0];
}
#endif
// NOTE: keep this in sync with kdebase/workspace/kcontrol/colors/colorscm.cpp
QColor KGlobalSettings::inactiveTitleColor()

View file

@ -169,17 +169,6 @@ public:
*/
static int autoSelectDelay();
/**
* Returns the KDE setting for the shortcut key to open
* context menus.
*
* @return the key that pops up context menus.
* @deprecated Simply reimplement QWidget::contextMenuEvent() instead.
*/
#ifndef KDE_NO_DEPRECATED
static KDE_DEPRECATED int contextMenuKey ();
#endif
/**
* Returns the KDE setting for context menus.
*

View file

@ -385,12 +385,6 @@ int KUniqueApplication::newInstance()
return 0; // do nothing in default implementation
}
#ifndef KDE_NO_DEPRECATED
void KUniqueApplication::setHandleAutoStarted()
{
Private::s_handleAutoStarted = false;
}
#endif
////

View file

@ -212,13 +212,6 @@ public:
*/
bool restoringSession();
/**
* @internal
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED static void setHandleAutoStarted();
#endif
private:
friend class KUniqueApplicationAdaptor;
class Private;

View file

@ -102,9 +102,6 @@ org::kde::kglobalaccel::Component *KGlobalAccelPrivate::getComponent(const QStri
KGlobalAccelPrivate::KGlobalAccelPrivate(KGlobalAccel *q)
: isUsingForeignComponentName(false),
#ifndef KDE_NO_DEPRECATED
enabled(true),
#endif
iface("org.kde.kglobalaccel", "/kglobalaccel", QDBusConnection::sessionBus()),
q(q)
{
@ -197,12 +194,6 @@ bool KGlobalAccel::isComponentActive(const QString &componentUnique)
}
#ifndef KDE_NO_DEPRECATED
bool KGlobalAccel::isEnabled() const
{
return d->enabled;
}
#endif
org::kde::kglobalaccel::Component *KGlobalAccel::getComponent(const QString &componentUnique)
@ -211,21 +202,8 @@ org::kde::kglobalaccel::Component *KGlobalAccel::getComponent(const QString &com
}
#ifndef KDE_NO_DEPRECATED
void KGlobalAccel::setEnabled(bool enabled)
{
d->enabled = enabled;
}
#endif
#ifndef KDE_NO_DEPRECATED
void KGlobalAccel::overrideMainComponentData(const KComponentData &kcd)
{
d->readComponentData(kcd);
d->isUsingForeignComponentName = true;
}
#endif
KGlobalAccel *KGlobalAccel::self()
@ -491,32 +469,6 @@ void KGlobalAccelPrivate::reRegisterAll()
}
}
#ifndef KDE_NO_DEPRECATED
QList<QStringList> KGlobalAccel::allMainComponents()
{
return d->iface.allMainComponents();
}
#endif
#ifndef KDE_NO_DEPRECATED
QList<QStringList> KGlobalAccel::allActionsForComponent(const QStringList &actionId)
{
return d->iface.allActionsForComponent(actionId);
}
#endif
//static
#ifndef KDE_NO_DEPRECATED
QStringList KGlobalAccel::findActionNameSystemwide(const QKeySequence &seq)
{
return self()->d->iface.action(seq[0]);
}
#endif
QList<KGlobalShortcutInfo> KGlobalAccel::getGlobalShortcutsByKey(const QKeySequence &seq)
{
return self()->d->iface.getGlobalShortcutsByKey(seq[0]);
@ -528,28 +480,6 @@ bool KGlobalAccel::isGlobalShortcutAvailable(const QKeySequence &seq, const QStr
return self()->d->iface.isGlobalShortcutAvailable(seq[0], comp);
}
//static
#ifndef KDE_NO_DEPRECATED
bool KGlobalAccel::promptStealShortcutSystemwide(QWidget *parent, const QStringList &actionIdentifier,
const QKeySequence &seq)
{
if (actionIdentifier.size() < 4) {
return false;
}
QString title = i18n("Conflict with Global Shortcut");
QString message = i18n("The '%1' key combination has already been allocated "
"to the global action \"%2\" in %3.\n"
"Do you want to reassign it from that action to the current one?",
seq.toString(), actionIdentifier.at(KGlobalAccel::ActionFriendly),
actionIdentifier.at(KGlobalAccel::ComponentFriendly));
return KMessageBox::warningContinueCancel(parent, message, title, KGuiItem(i18n("Reassign")))
== KMessageBox::Continue;
}
#endif
//static
bool KGlobalAccel::promptStealShortcutSystemwide(
QWidget *parent,

View file

@ -161,81 +161,6 @@ public:
const QList<KGlobalShortcutInfo> &shortcuts,
const QKeySequence &seq);
/**
* No effect.
*
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool isEnabled() const;
#endif
/**
* No effect.
*
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setEnabled(bool enabled);
#endif
/**
* Set the KComponentData for which to manipulate shortcuts. This is for exceptional
* situations, when you want to modify the shortcuts of another application
* as if they were yours.
* You cannot have your own working global shortcuts in a module/application using this
* special functionality. All global shortcuts of KActions will essentially be proxies.
* Be sure to set the default global shortcuts of the proxy KActions to the same as
* those on the receiving end.
* An example use case is the KControl Module for the window manager KWin, which has
* no own facility for users to change its global shortcuts.
*
* @param componentData a KComponentData about the application for which you want to
* manipulate shortcuts.
*
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void overrideMainComponentData(const KComponentData &componentData);
#endif
/**
* Return the unique and common names of all main components that have global shortcuts.
* The action strings of the returned actionId stringlists will be empty.
*
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QList<QStringList> allMainComponents();
#endif
/**
* @see getGlobalShortcutsByComponent
*
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QList<QStringList> allActionsForComponent(const QStringList &actionId);
#endif
/**
* @see getGlobalShortcutsByKey
*
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED static QStringList findActionNameSystemwide(const QKeySequence &seq);
#endif
/**
* @see promptStealShortcutSystemwide below
*
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED static bool promptStealShortcutSystemwide(QWidget *parent, const QStringList &actionIdentifier, const QKeySequence &seq);
#endif
private:
friend class KAction;

View file

@ -68,12 +68,6 @@ void KGlobalShortcutTest::setupTest(QString id)
// Ensure that the previous test did cleanup correctly
KGlobalAccel *kga = KGlobalAccel::self();
#ifndef KDE_NO_DEPRECATED
QList<QStringList> components = kga->allMainComponents();
QStringList componentId;
componentId << "qttest" << QString() << "KDE Test Program" << QString();
// QVERIFY(!components.contains(componentId));
#endif
m_actionA = new KAction("Text For Action A", this);
m_actionA->setObjectName("Action A:" + id);
@ -241,23 +235,7 @@ void KGlobalShortcutTest::testListActions()
// As in kdebase/workspace/kcontrol/keys/globalshortcuts.cpp
KGlobalAccel *kga = KGlobalAccel::self();
#ifndef KDE_NO_DEPRECATED
QList<QStringList> components = kga->allMainComponents();
//qDebug() << components;
QStringList componentId;
componentId << "qttest" << QString() << "KDE Test Program" << QString();
QVERIFY(components.contains(componentId));
#endif
#ifndef KDE_NO_DEPRECATED
QList<QStringList> actions = kga->allActionsForComponent(componentId);
QVERIFY(!actions.isEmpty());
QStringList actionIdA; actionIdA << "qttest" << "Action A:testListActions" << "KDE Test Program" << "Text For Action A";
QStringList actionIdB; actionIdB << "qttest" << "Action B:testListActions" << "KDE Test Program" << "Text For Action B";
//qDebug() << actions;
QVERIFY(actions.contains(actionIdA));
QVERIFY(actions.contains(actionIdB));
#endif
}
void KGlobalShortcutTest::testComponentAssignment()
@ -347,36 +325,6 @@ void KGlobalShortcutTest::testOverrideMainComponentData()
action->forgetGlobalShortcut();
delete coll.takeAction(action);
#ifndef KDE_NO_DEPRECATED
// activate overrideMainComponentData, it's not revokable currently!
// overrideMainComponentData only overrides the component if the action
// gets a real global shortcut!
KComponentData globalComponent("test_component2");
KGlobalAccel::self()->overrideMainComponentData(globalComponent);
// Action with action collection gets the global component
action = new KAction("Text For Action A", this);
QVERIFY(action->d->componentData == KGlobal::mainComponent());
action->setObjectName("Action A");
action->setGlobalShortcut(cutB, KAction::ActiveShortcut, KAction::NoAutoloading);
QVERIFY(action->d->componentData == globalComponent);
// Action with action collection get the component of the collection until
// a global shortcut is set when overrideMainComponentData is active
action->forgetGlobalShortcut();
delete action;
QVERIFY(coll.isEmpty());
action = coll.addAction("Action A");
QVERIFY(action->d->componentData == otherComponent);
action->setGlobalShortcut(cutB, KAction::ActiveShortcut, KAction::NoAutoloading);
QVERIFY(action->d->componentData == globalComponent);
// forget the global shortcut
action->forgetGlobalShortcut();
// Actions that were created by the KActionCollection::addAction have the
// collections as parent. Ensure action is not deleted.
#endif
}
void KGlobalShortcutTest::testNotification()
@ -418,12 +366,6 @@ void KGlobalShortcutTest::testForgetGlobalShortcut()
sleep(1);
KGlobalAccel *kga = KGlobalAccel::self();
#ifndef KDE_NO_DEPRECATED
QList<QStringList> components = kga->allMainComponents();
QStringList componentId;
componentId << "qttest" << QString() << "KDE Test Program" << QString();
QVERIFY(!components.contains(componentId));
#endif
}

View file

@ -60,31 +60,17 @@ private Q_SLOTS:
// setText emits textChanged and userTextChanged, but not textEdited
QSignalSpy textChangedSpy(&w, SIGNAL(textChanged(QString)));
QSignalSpy textEditedSpy(&w, SIGNAL(textEdited(QString)));
#ifndef KDE_NO_DEPRECATED
QSignalSpy userTextChangedSpy(&w, SIGNAL(userTextChanged(QString)));
#endif
w.setText("Hello worl");
#ifndef KDE_NO_DEPRECATED
QCOMPARE(userTextChangedSpy.count(), 1);
QCOMPARE(userTextChangedSpy[0][0].toString(), w.text());
#endif
QCOMPARE(textChangedSpy.count(), 1);
QCOMPARE(textChangedSpy[0][0].toString(), w.text());
QCOMPARE(textEditedSpy.count(), 0);
QVERIFY(!w.isModified());
#ifndef KDE_NO_DEPRECATED
userTextChangedSpy.clear();
#endif
textChangedSpy.clear();
textEditedSpy.clear();
// typing emits all three signals
QTest::keyClick(&w, Qt::Key_D);
QCOMPARE(w.text(), QString::fromLatin1("Hello world"));
#ifndef KDE_NO_DEPRECATED
QCOMPARE(userTextChangedSpy.count(), 1);
QCOMPARE(userTextChangedSpy[0][0].toString(), w.text());
#endif
QCOMPARE(textChangedSpy.count(), 1);
QCOMPARE(textChangedSpy[0][0].toString(), w.text());
QCOMPARE(textEditedSpy.count(), 1);
@ -92,9 +78,6 @@ private Q_SLOTS:
QVERIFY(w.isModified());
w.setText("K"); // prepare for next test
#ifndef KDE_NO_DEPRECATED
userTextChangedSpy.clear();
#endif
textChangedSpy.clear();
textEditedSpy.clear();
QVERIFY(!w.isModified());
@ -111,16 +94,10 @@ private Q_SLOTS:
w.doCompletion(w.text());
QCOMPARE(w.text(), items.at(0));
#ifndef KDE_NO_DEPRECATED
QCOMPARE(userTextChangedSpy.count(), 0);
#endif
QCOMPARE(textChangedSpy.count(), 1);
QCOMPARE(textChangedSpy[0][0].toString(), w.text());
QCOMPARE(textEditedSpy.count(), 0);
QVERIFY(!w.isModified());
#ifndef KDE_NO_DEPRECATED
userTextChangedSpy.clear();
#endif
textChangedSpy.clear();
textEditedSpy.clear();
@ -128,18 +105,11 @@ private Q_SLOTS:
QTest::keyClick(&w, Qt::Key_Right);
QCOMPARE(w.text(), items.at(0));
#ifndef KDE_NO_DEPRECATED
QCOMPARE(userTextChangedSpy.count(), 1);
QCOMPARE(userTextChangedSpy[0][0].toString(), w.text());
#endif
QCOMPARE(textChangedSpy.count(), 1);
QCOMPARE(textChangedSpy[0][0].toString(), w.text());
QCOMPARE(textEditedSpy.count(), 1);
QCOMPARE(textEditedSpy[0][0].toString(), w.text());
QVERIFY(w.isModified());
#ifndef KDE_NO_DEPRECATED
userTextChangedSpy.clear();
#endif
textChangedSpy.clear();
textEditedSpy.clear();
@ -147,18 +117,11 @@ private Q_SLOTS:
w.setCompletionMode(KGlobalSettings::CompletionPopup);
w.setText("KDE");
QVERIFY(!w.isModified());
#ifndef KDE_NO_DEPRECATED
userTextChangedSpy.clear();
#endif
textChangedSpy.clear();
textEditedSpy.clear();
w.doCompletion(w.text()); // popup appears
QCOMPARE(w.text(), QString::fromLatin1("KDE"));
#ifndef KDE_NO_DEPRECATED
QCOMPARE(textChangedSpy.count() + userTextChangedSpy.count() + textEditedSpy.count(), 0);
#else
QCOMPARE(textChangedSpy.count() + textEditedSpy.count(), 0);
#endif
w.completionBox()->down(); // select 1st item
QCOMPARE(w.text(), items.at(0));
QVERIFY(w.isModified());
@ -167,14 +130,8 @@ private Q_SLOTS:
// Selecting an item in the popup completion changes the lineedit text
// and emits textChanged and userTextChanged, but not textEdited.
#ifndef KDE_NO_DEPRECATED
QCOMPARE(userTextChangedSpy.count(), 2);
#endif
QCOMPARE(textChangedSpy.count(), 2);
QCOMPARE(textEditedSpy.count(), 0);
#ifndef KDE_NO_DEPRECATED
userTextChangedSpy.clear();
#endif
textChangedSpy.clear();
textEditedSpy.clear();
@ -185,9 +142,6 @@ private Q_SLOTS:
// Nothing else happens, the text was already set in the lineedit
QCOMPARE(textChangedSpy.count(), 0);
QCOMPARE(textEditedSpy.count(), 0);
#ifndef KDE_NO_DEPRECATED
QCOMPARE(userTextChangedSpy.count(), 0);
#endif
// Now when using the mouse in the popup completion
w.setText("KDE");

View file

@ -58,13 +58,6 @@ int main()
{
KXErrorHandler handle2( dpy );
XGetWindowAttributes(dpy, w, &attr);
#ifndef KDE_NO_DEPRECATED
{
KXErrorHandler handle3( handler3, dpy );
XSetInputFocus( dpy, w, RevertToParent, CurrentTime );
cout << "WAS3:" << handle3.error( /*false*/ true ) << endl;
}
#endif
cout << "WAS2:" << handle2.error( false ) << endl;
}
// XSync( dpy, False );

View file

@ -160,22 +160,6 @@ KIcon KGuiItem::icon( ) const
return KIcon();
}
// deprecated
#ifndef KDE_NO_DEPRECATED
QIcon KGuiItem::iconSet( KIconLoader::Group group, int size ) const
{
if (d->m_hasIcon && KGlobal::mainComponent().isValid()) {
if( !d->m_iconName.isEmpty()) {
KIconLoader* iconLoader = KIconLoader::global();
return iconLoader->loadIconSet( d->m_iconName, group, size );
} else {
return d->m_icon;
}
} else
return QIcon();
}
#endif
QString KGuiItem::iconName() const
{
return d->m_iconName;

View file

@ -59,11 +59,6 @@ public:
QString text() const;
QString plainText() const;
/// @deprecated use icon() instead
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED QIcon iconSet( KIconLoader::Group=KIconLoader::Small, int size = 0) const;
#endif
KIcon icon( ) const;
QString iconName() const;
@ -71,9 +66,6 @@ public:
QString whatsThis() const;
bool isEnabled() const;
bool hasIcon() const;
#if !defined(KDE_NO_COMPAT) && !defined(KDE_NO_DEPRECATED)
KDE_DEPRECATED bool hasIconSet() const { return hasIcon(); }
#endif
void setText( const QString &text );
void setIcon( const KIcon &iconset );

View file

@ -58,16 +58,6 @@ KXErrorHandler::KXErrorHandler( Display* dpy )
addHandler();
}
#ifndef KDE_NO_DEPRECATED
KXErrorHandler::KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy )
: user_handler1( handler ),
user_handler2( NULL ),
old_handler( XSetErrorHandler( handler_wrapper )),
d( new KXErrorHandlerPrivate(dpy) )
{
addHandler();
}
#endif
KXErrorHandler::KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy )
: user_handler1( NULL ),

View file

@ -74,15 +74,6 @@ class KDEUI_EXPORT KXErrorHandler
* value.
*/
explicit KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = QX11Info::display());
/**
* This constructor takes pointer to a function that will get request number,
* error code number and resource id of the failed request, as provided
* by XErrorEvent. If the function returns true, the error flag will be set.
* @deprecated Use the variant with XErrorEvent.
*/
#ifndef KDE_NO_DEPRECATED
explicit KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = QX11Info::display()) KDE_DEPRECATED;
#endif
/**
* This function returns true if the error flag is set (i.e. no custom handler
* function was used and there was any error, or the custom handler indicated

View file

@ -300,13 +300,6 @@ void KCharSelectTable::keyPressEvent(QKeyEvent *e)
/* Class: KCharSelect */
/******************************************************************/
#ifndef KDE_NO_DEPRECATED
KCharSelect::KCharSelect(QWidget *parent, const Controls controls)
: QWidget(parent), d(new KCharSelectPrivate(this))
{
init(controls, NULL);
}
#endif
KCharSelect::KCharSelect(
QWidget *parent

View file

@ -107,11 +107,6 @@ public:
Control)
/** @deprecated */
#ifndef KDE_NO_DEPRECATED
KDE_CONSTRUCTOR_DEPRECATED explicit KCharSelect(
QWidget *parent,
const Controls controls = AllGuiElements);
#endif
/**
* Constructor. @p controls can be used to show a custom set of widgets.

View file

@ -126,13 +126,6 @@ bool KComboBox::autoCompletion() const
return completionMode() == KGlobalSettings::CompletionAuto;
}
#ifndef KDE_NO_DEPRECATED
void KComboBox::setContextMenuEnabled( bool showMenu )
{
if( d->klineEdit )
d->klineEdit->setContextMenuEnabled( showMenu );
}
#endif
void KComboBox::setUrlDropsEnabled( bool enable )

View file

@ -177,20 +177,6 @@ public:
*/
virtual ~KComboBox();
/**
* Deprecated to reflect Qt api changes
* @deprecated
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void insertURL( const KUrl& url, int index = -1 )
{ insertUrl( index < 0 ? count() : index, url ); }
KDE_DEPRECATED void insertURL( const QPixmap& pixmap, const KUrl& url, int index = -1 )
{ insertUrl( index < 0 ? count() : index, QIcon(pixmap), url ); }
KDE_DEPRECATED void changeURL( const KUrl& url, int index )
{ changeUrl( index, url ); }
KDE_DEPRECATED void changeURL( const QPixmap& pixmap, const KUrl& url, int index )
{ changeUrl( index, QIcon(pixmap), url ); }
#endif
/**
* Sets @p url into the edit field of the combobox. It uses
@ -274,24 +260,6 @@ public:
*/
bool autoCompletion() const;
/**
* Enables or disable the popup (context) menu.
*
* This method only works if this widget is editable, i.e. read-write and
* allows you to enable/disable the context menu. It does nothing if invoked
* for a none-editable combo-box.
*
* By default, the context menu is created if this widget is editable.
* Call this function with the argument set to false to disable the popup
* menu.
*
* @param showMenu If @p true, show the context menu.
* @deprecated use setContextMenuPolicy
*/
#ifndef KDE_NO_DEPRECATED
virtual KDE_DEPRECATED void setContextMenuEnabled( bool showMenu );
#endif
/**
* Enables/Disables handling of URL drops. If enabled and the user
* drops an URL, the decoded URL will be inserted. Otherwise the default

View file

@ -347,13 +347,6 @@ void KKeySequenceWidget::setClearButtonShown(bool show)
d->clearButton->setVisible(show);
}
#ifndef KDE_NO_DEPRECATED
void KKeySequenceWidget::setCheckActionList(const QList<QAction*> &checkList) // deprecated
{
d->checkList = checkList;
Q_ASSERT(d->checkActionCollections.isEmpty()); // don't call this method if you call setCheckActionCollections!
}
#endif
void KKeySequenceWidget::setCheckActionCollections(const QList<KActionCollection *>& actionCollections)
{

View file

@ -226,16 +226,6 @@ public:
*/
void setCheckActionCollections(const QList<KActionCollection *>& actionCollections);
/**
* @deprecated since 4.1
* use setCheckActionCollections so that KKeySequenceWidget knows
* in which action collection to call the writeSettings method after stealing
* a shortcut from an action.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setCheckActionList(const QList<QAction*> &checkList);
#endif
/**
* If the component using this widget supports shortcuts contexts, it has
* to set its component name so we can check conflicts correctly.

View file

@ -109,9 +109,6 @@ public:
// KDE5: remove userTextChanged signal, textEdited does the same...
if (!completionRunning && (txt != userText)) {
userText = txt;
#ifndef KDE_NO_DEPRECATED
emit q->userTextChanged(txt);
#endif
}
}
@ -122,9 +119,6 @@ public:
if (!completionRunning && (txt != userText)) {
userText = txt;
q->setModified(true);
#ifndef KDE_NO_DEPRECATED
emit q->userTextChanged(txt);
#endif
emit q->textEdited(txt);
emit q->textChanged(txt);
}
@ -1819,19 +1813,7 @@ void KLineEdit::setClickMessage( const QString &msg )
update();
}
#ifndef KDE_NO_DEPRECATED
void KLineEdit::setContextMenuEnabled( bool showMenu )
{
QLineEdit::setContextMenuPolicy( showMenu ? Qt::DefaultContextMenu : Qt::NoContextMenu );
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KLineEdit::isContextMenuEnabled() const
{
return ( contextMenuPolicy() == Qt::DefaultContextMenu );
}
#endif
void KLineEdit::setPasswordMode(bool b)
{

View file

@ -152,9 +152,6 @@ class KDEUI_EXPORT KLineEdit : public QLineEdit, public KCompletionBase //krazy:
friend class KLineEditStyle;
Q_OBJECT
#ifndef KDE_NO_DEPRECATED
Q_PROPERTY( bool contextMenuEnabled READ isContextMenuEnabled WRITE setContextMenuEnabled )
#endif
Q_PROPERTY( bool urlDropsEnabled READ urlDropsEnabled WRITE setUrlDropsEnabled )
Q_PROPERTY( bool trapEnterKeyEvent READ trapReturnKey WRITE setTrapReturnKey )
Q_PROPERTY( bool squeezedTextEnabled READ isSqueezedTextEnabled WRITE setSqueezedTextEnabled )
@ -208,32 +205,6 @@ public:
*/
void setCompletionModeDisabled( KGlobalSettings::Completion mode, bool disable = true );
/**
* Enables/disables the popup (context) menu.
*
* This method only works if this widget is editable, i.e. read-write and
* allows you to enable/disable the context menu. It does nothing if invoked
* for a none-editable combo-box.
*
* By default, the context menu is created if this widget is editable.
* Call this function with the argument set to false to disable the popup
* menu.
*
* @param showMenu If @p true, show the context menu.
* @deprecated use setContextMenuPolicy
*/
#ifndef KDE_NO_DEPRECATED
virtual KDE_DEPRECATED void setContextMenuEnabled( bool showMenu );
#endif
/**
* Returns @p true when the context menu is enabled.
* @deprecated use contextMenuPolicy
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool isContextMenuEnabled() const;
#endif
/**
* Enables/Disables handling of URL drops. If enabled and the user
* drops an URL, the decoded URL will be inserted. Otherwise the default
@ -401,22 +372,6 @@ Q_SIGNALS:
*/
void substringCompletion( const QString& );
/**
* Emitted when the text is changed NOT by the suggested autocompletion:
* either when the user is physically typing keys, or when the text is changed programmatically,
* for example, by calling setText().
* But not when automatic completion changes the text temporarily.
*
* @since 4.2.2
* @deprecated since 4.5. You probably want to connect to textEdited() instead,
* which is emitted whenever the text is actually changed by the user
* (by typing or accepting autocompletion), without side effects from
* suggested autocompletion either. userTextChanged isn't needed anymore.
*/
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void userTextChanged( const QString & );
#endif
/**
* Emitted when the text rotation key-bindings are pressed.
*

View file

@ -95,14 +95,6 @@ KNumInput::KNumInput(QWidget* parent)
setFocusPolicy(Qt::StrongFocus);
}
#ifndef KDE_NO_DEPRECATED
KNumInput::KNumInput(QWidget* parent, KNumInput* below)
: QWidget(parent), d(new KNumInputPrivate(this, below))
{
setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
setFocusPolicy(Qt::StrongFocus);
}
#endif
KNumInput::~KNumInput()
{
@ -335,14 +327,6 @@ public:
};
#ifndef KDE_NO_DEPRECATED
KIntNumInput::KIntNumInput(KNumInput* below, int val, QWidget *parent, int _base)
: KNumInput(parent, below)
, d(new KIntNumInputPrivate(this, val))
{
init(val, _base);
}
#endif
KIntNumInput::KIntNumInput(QWidget *parent)
: KNumInput(parent)
@ -470,13 +454,6 @@ void KIntNumInput::setRange(int lower, int upper, int singleStep)
setSliderEnabled(priv->slider);
}
#ifndef KDE_NO_DEPRECATED
void KIntNumInput::setRange(int lower, int upper, int singleStep, bool slider)
{
setRange(lower, upper, singleStep);
setSliderEnabled(slider);
}
#endif
void KIntNumInput::setMinimum(int min)
{
@ -710,16 +687,6 @@ KDoubleNumInput::KDoubleNumInput(double lower, double upper, double value, QWidg
init(value, lower, upper, singleStep, precision);
}
#ifndef KDE_NO_DEPRECATED
KDoubleNumInput::KDoubleNumInput(KNumInput *below,
double lower, double upper, double value, QWidget *parent,
double singleStep, int precision)
: KNumInput(parent, below)
, d(new KDoubleNumInputPrivate(value))
{
init(value, lower, upper, singleStep, precision);
}
#endif
KDoubleNumInput::~KDoubleNumInput()
{

View file

@ -53,15 +53,6 @@ public:
*/
explicit KNumInput(QWidget* parent=0);
/**
* @param below A pointer to another KNumInput.
* @param parent parent widget
* \deprecated - use the version without the below parameter instead
*/
#ifndef KDE_NO_DEPRECATED
KDE_CONSTRUCTOR_DEPRECATED KNumInput(QWidget *parent, KNumInput* below);
#endif
/**
* Destructor
*/
@ -202,28 +193,6 @@ public:
*/
explicit KIntNumInput(int value, QWidget *parent=0,int base = 10);
/**
* Constructor
*
* the difference to the one above is the "below" parameter. It tells
* this instance that it is visually put below some other KNumInput widget.
* Note that these two KNumInput's need not to have the same parent widget
* or be in the same layout group.
* The effect is that it'll adjust its layout in correspondence
* with the layout of the other KNumInput's (you can build an arbitrary long
* chain).
*
* @param below append KIntNumInput to the KNumInput chain
* @param value initial value for the control
* @param base numeric base used for display
* @param parent parent QWidget
*
* \deprecated use the version without the below parameter instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_CONSTRUCTOR_DEPRECATED KIntNumInput(KNumInput* below, int value, QWidget *parent, int base = 10);
#endif
/**
* Destructor
*
@ -272,13 +241,6 @@ public:
*/
void setRange(int min, int max, int singleStep=1);
/**
* @deprecated Use the other setRange function and setSliderEnabled instead
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setRange(int min, int max, int singleStep, bool slider);
#endif
/**
* @param enabled Show the slider
* @default enabled
@ -489,33 +451,6 @@ public:
virtual ~KDoubleNumInput();
/**
* Constructor
*
* the difference here is the "below" parameter. It tells this
* instance that it is visually put below some other KNumInput
* widget. Note that these two KNumInput's need not to have the
* same parent widget or be in the same layout group. The effect
* is that it'll adjust its layout in correspondence with the
* layout of the other KNumInput's (you can build an arbitrary long
* chain).
*
* @param below append KDoubleNumInput to the KDoubleNumInput chain
* @param lower lower boundary value
* @param upper upper boundary value
* @param value initial value for the control
* @param singleStep step size to use for up/down arrow clicks
* @param precision number of digits after the decimal point
* @param parent parent QWidget
*
* \deprecated use the version without below instead
*/
#ifndef KDE_NO_DEPRECATED
KDE_CONSTRUCTOR_DEPRECATED KDoubleNumInput(KNumInput* below,
double lower, double upper, double value, QWidget *parent=0,double singleStep=0.02,
int precision=2);
#endif
/**
* @return the current value.
*/
@ -591,9 +526,6 @@ public:
*/
void setDecimals(int decimals);
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setPrecision(int precision) { setDecimals(precision); }
#endif
/**
* @return the reference point for relativeValue calculation

View file

@ -59,12 +59,6 @@ KRatingWidget::~KRatingWidget()
}
#ifndef KDE_NO_DEPRECATED
void KRatingWidget::setPixmap( const QPixmap& pix )
{
setCustomPixmap( pix );
}
#endif
void KRatingWidget::setCustomPixmap( const QPixmap& pix )
@ -151,12 +145,6 @@ bool KRatingWidget::halfStepsEnabled() const
}
#ifndef KDE_NO_DEPRECATED
void KRatingWidget::setRating( unsigned int rating )
{
setRating( (int)rating );
}
#endif
void KRatingWidget::setRating( int rating )
@ -171,12 +159,6 @@ void KRatingWidget::setRating( int rating )
}
#ifndef KDE_NO_DEPRECATED
void KRatingWidget::setMaxRating( unsigned int max )
{
setMaxRating( (int)max );
}
#endif
void KRatingWidget::setMaxRating( int max )
@ -193,12 +175,6 @@ void KRatingWidget::setHalfStepsEnabled( bool enabled )
}
#ifndef KDE_NO_DEPRECATED
void KRatingWidget::setOnlyPaintFullSteps( bool fs )
{
setHalfStepsEnabled( !fs );
}
#endif
void KRatingWidget::mousePressEvent( QMouseEvent* e )

View file

@ -124,13 +124,6 @@ class KDEUI_EXPORT KRatingWidget : public QFrame
*/
void setRating( int rating );
/**
* \deprecated use setRating( int rating )
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setRating( unsigned int rating );
#endif
/**
* Set the maximum allowed rating value. The default is 10 which means
* that a rating from 1 to 10 is selectable. If \a max is uneven steps
@ -138,26 +131,12 @@ class KDEUI_EXPORT KRatingWidget : public QFrame
*/
void setMaxRating( int max );
/**
* \deprecated use setMaxRating( int max )
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setMaxRating( unsigned int max );
#endif
/**
* If half steps are enabled (the default) then
* one rating step corresponds to half a star.
*/
void setHalfStepsEnabled( bool enabled );
/**
* \deprecated Use setHalfStepsEnabled
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setOnlyPaintFullSteps( bool );
#endif
/**
* Set the spacing between the pixmaps. The default is 0.
*/
@ -184,16 +163,6 @@ class KDEUI_EXPORT KRatingWidget : public QFrame
*/
void setCustomPixmap( const QPixmap& pixmap );
/**
* Set the pixap to be used to display a rating step.
* By default the "rating" pixmap is loaded.
*
* \deprecated use setCustomPixmap
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setPixmap( const QPixmap& );
#endif
/**
* Set the recommended size of the pixmaps. This is
* only used for the sizeHint. The actual size is always

View file

@ -187,33 +187,9 @@ KRuler::~KRuler()
delete d;
}
#ifndef KDE_NO_DEPRECATED
void
KRuler::setMinValue(int value)
{
setMinimum(value);
}
#endif
#ifndef KDE_NO_DEPRECATED
int
KRuler::minValue() const
{ return minimum(); }
#endif
#ifndef KDE_NO_DEPRECATED
void
KRuler::setMaxValue(int value)
{
setMaximum(value);
}
#endif
#ifndef KDE_NO_DEPRECATED
int
KRuler::maxValue() const
{ return maximum(); }
#endif
void
KRuler::setTinyMarkDistance(int dist)

View file

@ -152,42 +152,6 @@ public:
*/
~KRuler();
/**
* Sets the minimal value of the ruler pointer (default is 0).
*
* This method calls update() so that the widget is painted after leaving
* to the main event loop.
*
**/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setMinValue(int);
#endif
/**
* Returns the minimal value of the ruler pointer.
**/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED int minValue() const;
#endif
/**
* Sets the maximum value of the ruler pointer (default is 100).
*
* This method calls update() so that the widget is painted after leaving
* to the main event loop.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setMaxValue(int);
#endif
/**
* Returns the maximal value of the ruler pointer.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED int maxValue() const;
#endif
/**
* Sets the distance between tiny marks.
*

View file

@ -85,13 +85,6 @@ KShortcut KShortcutWidget::shortcut() const
return ret;
}
#ifndef KDE_NO_DEPRECATED
void KShortcutWidget::setCheckActionList(const QList<QAction*> &checkList)
{
d->ui.priEditor->setCheckActionList(checkList);
d->ui.altEditor->setCheckActionList(checkList);
}
#endif
void KShortcutWidget::setCheckActionCollections(const QList<KActionCollection *>& actionCollections)
{

View file

@ -58,16 +58,6 @@ public:
*/
void setCheckActionCollections(const QList<KActionCollection *>& actionCollections);
/**
* @deprecated since 4.1
* Use setCheckActionCollections so that KShortcutWidget knows
* in which action collection to call the writeSettings method after stealing
* a shortcut from an action.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setCheckActionList(const QList<QAction*> &checkList);
#endif
Q_SIGNALS:
void shortcutChanged(const KShortcut &cut);

View file

@ -62,9 +62,6 @@ KTabBar::KTabBar( QWidget *parent )
d->mActivateDragSwitchTabTimer = new QTimer( this );
d->mActivateDragSwitchTabTimer->setSingleShot( true );
connect( d->mActivateDragSwitchTabTimer, SIGNAL(timeout()), SLOT(activateDragSwitchTab()) );
#ifndef KDE_NO_DEPRECATED
connect( this, SIGNAL(tabCloseRequested(int)), this, SIGNAL(closeRequest(int))); // just for backward compatibility, KDE5 remove
#endif
//connect( this, SIGNAL(layoutChanged()), SLOT(onLayoutChange()) );
}
@ -84,9 +81,6 @@ void KTabBar::mouseDoubleClickEvent( QMouseEvent *event )
if(tab == -1) {
emit newTabRequest();
} else {
#ifndef KDE_NO_DEPRECATED
emit mouseDoubleClick( tab ); //deprecated
#endif
emit tabDoubleClicked( tab );
}
@ -174,20 +168,8 @@ void KTabBar::mouseMoveEvent( QMouseEvent *event )
}
#ifndef KDE_NO_DEPRECATED
void KTabBar::closeButtonClicked()
{
// deprecated
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabBar::enableCloseButton()
{
// deprecated
}
#endif
void KTabBar::activateDragSwitchTab()
@ -341,80 +323,16 @@ void KTabBar::wheelEvent( QWheelEvent *event )
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabBar::isTabReorderingEnabled() const
{
return d->mTabReorderingEnabled;
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabBar::setTabReorderingEnabled( bool on )
{
d->mTabReorderingEnabled = on;
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabBar::tabCloseActivatePrevious() const
{
return selectionBehaviorOnRemove() == QTabBar::SelectPreviousTab;
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabBar::setTabCloseActivatePrevious( bool on )
{
setSelectionBehaviorOnRemove(on ? QTabBar::SelectPreviousTab : QTabBar::SelectRightTab);
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabBar::setHoverCloseButton( bool button )
{
// deprecated
setTabsClosable(button);
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabBar::hoverCloseButton() const
{
// deprecated
return tabsClosable();
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabBar::setHoverCloseButtonDelayed( bool delayed )
{
// deprecated
Q_UNUSED( delayed );
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabBar::hoverCloseButtonDelayed() const
{
// deprecated
return false;
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabBar::setCloseButtonEnabled( bool enable )
{
QTabBar::setTabsClosable(enable);
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabBar::isCloseButtonEnabled() const
{
return QTabBar::tabsClosable();
}
#endif
void KTabBar::tabLayoutChange()
{

View file

@ -48,108 +48,6 @@ class KDEUI_EXPORT KTabBar: public QTabBar //krazy:exclude=qclasses
*/
virtual ~KTabBar();
/**
* Sets the tab reordering enabled or disabled. If enabled,
* the user can reorder the tabs by drag and drop the tab
* headers with the middle mouse button.
*
* @deprecated Use QTabBar::setMovable() instead.
*
* Note, however, that QTabBar::setMovable(true) disables
* dragging tabs out of the KTabBar (e.g., dragging the tab
* URL from Konqueror to another application)!
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setTabReorderingEnabled( bool enable );
#endif
/**
* Returns whether tab reordering is enabled.
*
* @deprecated Use QTabBar::isMovable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool isTabReorderingEnabled() const;
#endif
/**
* If enabled, a close button is shown above the tab icon.
* The signal KTabBar::closeRequest() is emitted, if the
* close button has been clicked. Note that the tab must have
* an icon to use this feature.
*
* @deprecated Use QTabBar::setTabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setHoverCloseButton( bool );
#endif
/** @deprecated Use QTabBar::tabsClosable() instead. */
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool hoverCloseButton() const;
#endif
/**
* If enabled, the close button cannot get clicked until a
* minor delay has been passed. This prevents that user
* accidentally closes a tab.
*
* @deprecated Use QTabBar::setTabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setHoverCloseButtonDelayed( bool );
#endif
/** @deprecated Use QTabBar::tabsClosable() instead. */
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool hoverCloseButtonDelayed() const;
#endif
/**
* If enabled, a close button is available for each tab. The
* signal KTabBar::closeRequest() is emitted, if the close button
* has been clicked.
*
* @since 4.1
*
* @deprecated Use QTabBar::setTabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setCloseButtonEnabled( bool );
#endif
/**
* Returns true if the close button is shown on tabs.
*
* @since 4.1
*
* @deprecated Use QTabBar::tabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool isCloseButtonEnabled() const;
#endif
/**
* Sets the 'activate previous tab on close' feature enabled
* or disabled. If enabled, as soon as you close a tab, the
* previously selected tab is activated again.
*
* @deprecated Use QTabBar::setSelectionBehaviorOnRemove() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void setTabCloseActivatePrevious( bool );
#endif
/**
* Returns whether the 'activate previous tab on close' feature
* is enabled.
*
* @deprecated Use QTabBar::selectionBehaviorOnRemove() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool tabCloseActivatePrevious() const;
#endif
/**
* Selects the tab which has a tab header at
* given @param position.
@ -169,10 +67,6 @@ class KDEUI_EXPORT KTabBar: public QTabBar //krazy:exclude=qclasses
* The signal is emitted on the press of the mouse button.
*/
void emptyAreaContextMenu( const QPoint& globalPos );
/** @deprecated use tabDoubleClicked(int) and newTabRequest() instead. */
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void mouseDoubleClick( int );
#endif
/**
* A double left mouse button click was performed over the tab with the @param index.
* The signal is emitted on the second press of the mouse button, before the release.
@ -196,10 +90,6 @@ class KDEUI_EXPORT KTabBar: public QTabBar //krazy:exclude=qclasses
* Tells the KTabWidget which owns the KTabBar to move a tab.
*/
void moveTab( int, int );
/** @deprecated Use QTabBar::tabCloseRequested(int) instead. */
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void closeRequest( int );
#endif
#ifndef QT_NO_WHEELEVENT
void wheelDelta( int );
#endif
@ -222,14 +112,6 @@ class KDEUI_EXPORT KTabBar: public QTabBar //krazy:exclude=qclasses
virtual QSize tabSizeHint( int index ) const;
protected Q_SLOTS:
/** @deprecated */
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void closeButtonClicked();
#endif
/** @deprecated */
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void enableCloseButton();
#endif
virtual void activateDragSwitchTab();
protected:

View file

@ -316,33 +316,9 @@ QColor KTabWidget::tabTextColor( int index ) const
return tabBar()->tabTextColor( index );
}
#ifndef KDE_NO_DEPRECATED
void KTabWidget::setTabReorderingEnabled( bool on)
{
static_cast<KTabBar*>(tabBar())->setTabReorderingEnabled( on );
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabWidget::isTabReorderingEnabled() const
{
return static_cast<KTabBar*>(tabBar())->isTabReorderingEnabled();
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabWidget::setTabCloseActivatePrevious( bool previous)
{
static_cast<KTabBar*>(tabBar())->setTabCloseActivatePrevious( previous );
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabWidget::tabCloseActivatePrevious() const
{
return static_cast<KTabBar*>(tabBar())->tabCloseActivatePrevious();
}
#endif
int KTabWidget::tabBarWidthForMaxChars( int maxLength )
{
@ -361,12 +337,6 @@ int KTabWidget::tabBarWidthForMaxChars( int maxLength )
if ( !tabBar()->tabIcon( i ).isNull() ) {
iw = tabBar()->tabIcon( i ).pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), QIcon::Normal ).width() + 4;
}
#ifndef KDE_NO_DEPRECATED
if ( isCloseButtonEnabled() ) {
// FIXME: how to get the size of the close button directly from the tabBar()?
iw += KIconLoader::SizeSmall * 3 / 2;
}
#endif
x += ( tabBar()->style()->sizeFromContents( QStyle::CT_TabBarTab, 0L,
QSize( qMax( lw + hframe + iw, QApplication::globalStrut().width() ), 0 ),
this ) ).width();
@ -592,9 +562,6 @@ void KTabWidget::moveTab( int from, int to )
setUpdatesEnabled(true);
#ifndef KDE_NO_DEPRECATED
emit ( movedTab( from, to ) );
#endif
}
void KTabWidget::removePage( QWidget *widget )
@ -622,51 +589,11 @@ void KTabWidget::removeTab( int index )
}
}
#ifndef KDE_NO_DEPRECATED
void KTabWidget::setHoverCloseButton( bool button )
{
// deprecated
setTabsClosable( button );
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabWidget::hoverCloseButton() const
{
// deprecated
return false;
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabWidget::setHoverCloseButtonDelayed( bool delayed )
{
// deprecated
Q_UNUSED( delayed );
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabWidget::hoverCloseButtonDelayed() const
{
// deprecated
return tabsClosable();
}
#endif
#ifndef KDE_NO_DEPRECATED
void KTabWidget::setCloseButtonEnabled( bool enable )
{
static_cast<KTabBar*>( tabBar() )->setTabsClosable( enable );
}
#endif
#ifndef KDE_NO_DEPRECATED
bool KTabWidget::isCloseButtonEnabled() const
{
return static_cast<KTabBar*>( tabBar() )->tabsClosable();
}
#endif
void KTabWidget::setAutomaticResizeTabs( bool enabled )
{
@ -716,11 +643,4 @@ void KTabWidget::tabRemoved( int idx )
// d->m_tabNames is now updated in KTabWidget::Private::removeTab()
}
/* This function is kept only for BC reasons, it is not useful anymore */
#ifndef KDE_NO_DEPRECATED
void KTabWidget::currentChanged( int )
{
}
#endif
#include "moc_ktabwidget.cpp"

View file

@ -44,13 +44,6 @@ class QTab;
class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
{
Q_OBJECT
#ifndef KDE_NO_DEPRECATED
Q_PROPERTY( bool tabReorderingEnabled READ isTabReorderingEnabled WRITE setTabReorderingEnabled )
Q_PROPERTY( bool hoverCloseButton READ hoverCloseButton WRITE setHoverCloseButton )
Q_PROPERTY( bool hoverCloseButtonDelayed READ hoverCloseButtonDelayed WRITE setHoverCloseButtonDelayed )
Q_PROPERTY( bool closeButtonEnabled READ isCloseButtonEnabled WRITE setCloseButtonEnabled )
Q_PROPERTY( bool tabCloseActivatePrevious READ tabCloseActivatePrevious WRITE setTabCloseActivatePrevious )
#endif
Q_PROPERTY( bool automaticResizeTabs READ automaticResizeTabs WRITE setAutomaticResizeTabs )
public:
@ -80,57 +73,6 @@ class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
*/
QColor tabTextColor( int index ) const;
/**
* Returns true if tab ordering with the middle mouse button
* has been enabled.
*
* @deprecated Use QTabWidget::isMovable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool isTabReorderingEnabled() const;
#endif
/**
* Returns true if the close button is shown on tabs
* when mouse is hovering over them.
*
* @deprecated Use QTabWidget::tabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool hoverCloseButton() const;
#endif
/**
* Returns true if the close button is shown on tabs
* after a delay.
*
* @deprecated Use QTabWidget::setTabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool hoverCloseButtonDelayed() const;
#endif
/**
* Returns true if the close button is shown on tabs.
*
* @since 4.1
*
* @deprecated Use QTabWidget::tabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool isCloseButtonEnabled() const;
#endif
/**
* Returns true if closing the current tab activates the previous
* actice tab instead of the one to the right.
*
* @deprecated Use tabBar()->selectionBehaviorOnRemove() instead.
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED bool tabCloseActivatePrevious() const;
#endif
/**
* Returns true if calling setTitle() will resize tabs
* to the width of the tab bar.
@ -198,69 +140,6 @@ class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
*/
virtual void removeTab(int index); // but it's not virtual in QTabWidget...
/**
* If \a enable is true, tab reordering with middle button will be enabled.
*
* Note that once enabled you shouldn't rely on previously queried
* currentPageIndex() or indexOf( QWidget * ) values anymore.
*
* You can connect to signal movedTab(int, int) which will notify
* you from which index to which index a tab has been moved.
*
* @deprecated Use QTabWidget::setMovable() instead.
*
* Note, however, that QTabWidget::setMovable(true) disables
* dragging tabs out of the KTabBar (e.g., dragging the tab
* URL from Konqueror to another application)!
*/
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void setTabReorderingEnabled( bool enable );
#endif
/**
* If \a enable is true, a close button will be shown on mouse hover
* over tab icons which will emit signal closeRequest( QWidget * )
* when pressed.
*
* @deprecated Use QTabWidget::setTabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void setHoverCloseButton( bool enable );
#endif
/**
* If \a delayed is true, a close button will be shown on mouse hover
* over tab icons after mouse double click delay else immediately.
*
* @deprecated Use QTabWidget::setTabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void setHoverCloseButtonDelayed( bool delayed );
#endif
/**
* If enabled, a close button is available for each tab. The
* signal KTabWidget::closeRequest() is emitted, if the close button
* has been clicked.
*
* @since 4.1
*
* @deprecated Use QTabWidget::setTabsClosable() instead.
*/
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void setCloseButtonEnabled( bool );
#endif
/**
* If \a previous is true, closing the current tab activates the
* previous active tab instead of the one to the right.
*
* @deprecated Use tabBar()->setSelectionBehaviorOnRemove() instead.
*/
#ifndef KDE_NO_DEPRECATED
QT_MOC_COMPAT void setTabCloseActivatePrevious( bool previous );
#endif
/**
* If \a enable is true, tabs will be resized to the width of the tab bar.
*
@ -302,13 +181,6 @@ class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
*/
void contextMenu( QWidget *, const QPoint & );
#ifndef KDE_NO_DEPRECATED
/**
* A tab was moved from first to second index. This signal is only
* possible after you have called setTabReorderingEnabled( true ).
*/
void movedTab( int, int );
#endif
/**
* A double left mouse button click was performed over empty space besides tabbar.
@ -355,13 +227,6 @@ class KDEUI_EXPORT KTabWidget : public QTabWidget //krazy:exclude=qclasses
virtual void tabInserted( int );
virtual void tabRemoved ( int );
/**
* @deprecated This method has no effect and should not be called
*/
#ifndef KDE_NO_DEPRECATED
KDE_DEPRECATED void currentChanged( int );
#endif
protected Q_SLOTS:
virtual void receivedDropEvent( int, QDropEvent* );
virtual void initiateDrag( int );

Some files were not shown because too many files have changed in this diff Show more