mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
962b0b0ef1
commit
38107cb5c7
4 changed files with 19 additions and 19 deletions
|
@ -122,7 +122,6 @@ static KMimeType::Ptr findFromMode(const QString &path,
|
|||
}
|
||||
|
||||
/*
|
||||
|
||||
As agreed on the XDG list (and unlike the current shared-mime spec):
|
||||
|
||||
Glob-matching should prefer derived mimetype over base mimetype, and longer matches
|
||||
|
@ -150,7 +149,6 @@ So there's also a fast mode which is:
|
|||
if no glob matches, or if more than one glob matches, use default mimetype and mark as "can be refined".
|
||||
|
||||
*/
|
||||
|
||||
KMimeType::Ptr KMimeType::findByUrlHelper(const KUrl &_url, mode_t mode,
|
||||
bool is_local_file,
|
||||
QIODevice *device,
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
|
||||
extern int servicesDebugArea();
|
||||
|
||||
thread_local KMimeTypeFactory* kMimeTypeFactoryInstance = 0;
|
||||
thread_local KMimeTypeFactory* kMimeTypeFactoryInstance = nullptr;
|
||||
|
||||
KMimeTypeFactory::KMimeTypeFactory()
|
||||
: KSycocaFactory( KST_KMimeTypeFactory )
|
||||
: KSycocaFactory(KST_KMimeTypeFactory)
|
||||
{
|
||||
kMimeTypeFactoryInstance = this;
|
||||
}
|
||||
|
@ -39,18 +39,20 @@ KMimeTypeFactory::~KMimeTypeFactory()
|
|||
}
|
||||
}
|
||||
|
||||
KMimeTypeFactory * KMimeTypeFactory::self()
|
||||
KMimeTypeFactory* KMimeTypeFactory::self()
|
||||
{
|
||||
if (!kMimeTypeFactoryInstance)
|
||||
if (!kMimeTypeFactoryInstance) {
|
||||
kMimeTypeFactoryInstance = new KMimeTypeFactory();
|
||||
}
|
||||
return kMimeTypeFactoryInstance;
|
||||
}
|
||||
|
||||
int KMimeTypeFactory::entryOffset(const QString& mimeTypeName)
|
||||
int KMimeTypeFactory::entryOffset(const QString &mimeTypeName)
|
||||
{
|
||||
if (!sycocaDict())
|
||||
if (!sycocaDict()) {
|
||||
return -1; // Error!
|
||||
assert (!KSycoca::self()->isBuilding());
|
||||
}
|
||||
assert(!KSycoca::self()->isBuilding());
|
||||
const int offset = sycocaDict()->find_string(mimeTypeName);
|
||||
return offset;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class KSycoca;
|
|||
*/
|
||||
class KDECORE_EXPORT KMimeTypeFactory : public KSycocaFactory
|
||||
{
|
||||
K_SYCOCAFACTORY( KST_KMimeTypeFactory )
|
||||
K_SYCOCAFACTORY(KST_KMimeTypeFactory)
|
||||
public:
|
||||
/**
|
||||
* Create factory
|
||||
|
@ -51,17 +51,17 @@ public:
|
|||
* Not meant to be called at this level
|
||||
*/
|
||||
virtual KSycocaEntry *createEntry(const QString &, const char *) const
|
||||
{ assert(0); return 0; }
|
||||
{ assert(false); return nullptr; }
|
||||
|
||||
/**
|
||||
* Returns the possible offset for a given mimetype entry.
|
||||
*/
|
||||
int entryOffset(const QString& mimeTypeName);
|
||||
int entryOffset(const QString &mimeTypeName);
|
||||
|
||||
/**
|
||||
* Returns the offset into the service offers for a given mimetype.
|
||||
*/
|
||||
int serviceOffersOffset(const QString& mimeTypeName);
|
||||
int serviceOffersOffset(const QString &mimeTypeName);
|
||||
|
||||
public:
|
||||
/**
|
||||
|
@ -73,19 +73,19 @@ public:
|
|||
/**
|
||||
* @return the unique mimetype factory, creating it if necessary
|
||||
*/
|
||||
static KMimeTypeFactory * self();
|
||||
static KMimeTypeFactory* self();
|
||||
|
||||
public: // public for KBuildServiceFactory
|
||||
// A small entry for each mimetype with name and offset into the services-offer-list.
|
||||
class MimeTypeEntryPrivate;
|
||||
class KDECORE_EXPORT MimeTypeEntry : public KSycocaEntry
|
||||
{
|
||||
Q_DECLARE_PRIVATE( MimeTypeEntry )
|
||||
Q_DECLARE_PRIVATE(MimeTypeEntry)
|
||||
public:
|
||||
typedef KSharedPtr<MimeTypeEntry> Ptr;
|
||||
|
||||
MimeTypeEntry(const QString& file, const QString& name);
|
||||
MimeTypeEntry(QDataStream& s, int offset);
|
||||
MimeTypeEntry(const QString &file, const QString &name);
|
||||
MimeTypeEntry(QDataStream &s, int offset);
|
||||
|
||||
int serviceOffersOffset() const;
|
||||
void setServiceOffersOffset(int off);
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
* indeed matches the search key. If it doesn't
|
||||
* then no matching entry exists.
|
||||
*/
|
||||
int find_string(const QString &key ) const;
|
||||
int find_string(const QString &key) const;
|
||||
|
||||
/**
|
||||
* Looks up all entries identified by 'key'.
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
* After loading each entry you should check that it
|
||||
* indeed matches the search key.
|
||||
*/
|
||||
QList<int> findMultiString(const QString &key ) const;
|
||||
QList<int> findMultiString(const QString &key) const;
|
||||
|
||||
/**
|
||||
* The number of entries in the dictionary.
|
||||
|
|
Loading…
Add table
Reference in a new issue