This file is indexed.

/usr/include/libtomahawk/accounts/ResolverAccount.h is in libtomahawk-dev 0.8.4+dfsg1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 *
 *   Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
 *   Copyright 2013,      Teo Mrnjavac <teo@kde.org>
 *
 *   Tomahawk is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Tomahawk 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 General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef RESOLVERACCOUNT_H
#define RESOLVERACCOUNT_H

#include "accounts/Account.h"
#include "DllMacro.h"

#include <QPointer>

class QDir;

namespace Tomahawk {

class ExternalResolverGui;

namespace Accounts {

class DLLEXPORT ResolverAccountFactory : public AccountFactory
{
    Q_OBJECT
public:
    ResolverAccountFactory() {}
    virtual ~ResolverAccountFactory() {}

    virtual Account* createAccount( const QString& accountId = QString() );
    virtual QString factoryId() const  { return "resolveraccount"; }
    virtual QString description() const { return QString(); }
    virtual QString prettyName() const { return QString(); } // Internal, not displayed
    AccountTypes types() const { return AccountTypes( ResolverType ); }
    virtual bool allowUserCreation() const { return false; }

    // Used to create a new resolver from a script on disk, either chosen by
    // the user, or installed from synchrotron
    virtual bool acceptsPath( const QString&  ) const { return true; } // This is the catch-all filesystem account
    virtual Account* createFromPath( const QString& path );

    // Internal use
    static Account* createFromPath( const QString& path, const QString& factoryId, bool isAttica );

private:
    static QVariantHash metadataFromJsonFile( const QString& path );
    static void expandPaths( const QDir& contentDir, QVariantHash& configuration );
};

/**
 * Helper wrapper class that is a resolver-only account.
 *
 * Contains the resolver* that is it wrapping
 */
class DLLEXPORT ResolverAccount : public Account
{
    Q_OBJECT
public:
    // Loads from config. Must already exist.
    explicit ResolverAccount( const QString& accountId );
    virtual ~ResolverAccount();

    virtual void authenticate();
    virtual void deauthenticate();
    virtual bool isAuthenticated() const;
    virtual Tomahawk::Accounts::Account::ConnectionState connectionState() const;

    virtual AccountConfigWidget* configurationWidget();
    virtual QString errorMessage() const;

    virtual void saveConfig();
    virtual void removeFromConfig();

    QString path() const;

    virtual QPixmap icon() const;
    virtual QString description() const;
    virtual QString author() const;
    virtual QString version() const;

    // Not relevant
    virtual SipPlugin* sipPlugin( bool ) { return 0; }
    virtual Tomahawk::InfoSystem::InfoPluginPtr infoPlugin() { return Tomahawk::InfoSystem::InfoPluginPtr(); }
    virtual QWidget* aclWidget() { return 0; }

    virtual void removeBundle();

private slots:
    void resolverChanged();

protected:
    // Created by factory, when user installs a new resolver
    ResolverAccount( const QString& accountId, const QString& path, const QVariantHash& initialConfiguration = QVariantHash() );
    void hookupResolver();

    QPointer<ExternalResolverGui> m_resolver;

private:
    void init( const QString& path );

    friend class ResolverAccountFactory;
};


/**
 * Extends ResolverAccount with what attica additionally provides---e.g. icon
 * Assumes certain file layout on disk.
 */
class DLLEXPORT AtticaResolverAccount : public ResolverAccount
{
    Q_OBJECT
public:
    // Loads from config
    explicit AtticaResolverAccount( const QString& accountId );
    virtual ~AtticaResolverAccount();

    virtual QPixmap icon() const;

    QString atticaId() const { return m_atticaId; }

    void setPath( const QString& path );

private slots:
    void resolverIconUpdated( const QString& );

    void loadIcon();

private:
    // Created by factory, when user installs a new resolver
    AtticaResolverAccount( const QString& accountId, const QString& path, const QString& atticaId, const QVariantHash& initialConfiguration = QVariantHash() );

    void init();

    QPixmap m_icon;
    QString m_atticaId;

    friend class ResolverAccountFactory;
};

}
}

#endif // RESOLVERACCOUNT_H