Wadseeker Class Reference

Main controlling class. More...

List of all members.

Public Types

enum  MessageType { Notice = 0, Error = 1, CriticalError = 2 }


void aborted ()
void allDone ()
void downloadProgress (int done, int total)
void message (const QString &msg, Wadseeker::MessageType type)

Public Member Functions

 Wadseeker ()
 ~Wadseeker ()
void abort ()
bool areAllFilesFound () const
const QStringList & filesNotFound () const
void seekWads (const QStringList &wads)
void setCustomSite (const QUrl &url)
void setPrimarySites (const QStringList &lst)
void setPrimarySitesToDefault ()
void setTargetDirectory (const QString &dir)
void setUseIdgames (bool use, bool highPriority=false, QString archiveURL=defaultIdgamesUrl())
QString targetDirectory () const

Static Public Member Functions

static const QString author ()
static const QString defaultIdgamesUrl ()
static QStringList defaultSitesListEncoded ()
static const QString description ()
static bool isIwad (const QString &wad)
static void setTimeConnectTimeout (int seconds)
static void setTimeDownloadTimeout (int seconds)
static const QString version ()
static const QString yearSpan ()

Static Public Attributes

static const QString defaultSites []
static const QString iwadNames []

Protected Slots

void messageSlot (const QString &msg, int type)
void wwwAborted ()

Static Protected Member Functions

static QStringList wantedFilenames (const QString &wad, QString &zip)

Detailed Description

Main controlling class.

The Wadseeker class provides an interface for searching for and downloading modifications for Doom engine games. Wadseeker will search for mods in a list of locations provided by setPrimarySites.

Wadseeker will ignore a predefined set of file names which it suspects to be attempts to illegally download commercial game data, so passing in any name which is found in iwadNames will result in the file being ignored.


Using Wadseeker is quite simple, there are three steps required for use:
  1. Initialize an instance of Wadseeker
  2. Configure some values such as the sites to search in and target directory.
  3. Create a list of wads to search for and pass it into seekWads.

Observe the following example on how to do these things.

    Wadseeker ws;
    ws.setPrimarySitesToDefault(); // Use the default list of sites
    QStringList listOfWads;
    listOfWads << "doom2.wad"; // This will be ignored beacuse of iwadNames
    listOfWads << "somemod.wad";
    listOfWads << "somemod.pk3";

Member Enumeration Documentation

Wadseeker library uses a message system that contains a type of message together with a string representing it's content. Types should be treated as follows:

  • Notice - this is just an information of what Wadseeker is currently doing
  • Error - something bad happened but Wadseeker is able to continue by itself.
  • CriticalError - Wadseeker stops working after such error. Programmer should return control to the main application.

Constructor & Destructor Documentation

Wadseeker::Wadseeker (  ) 

Initializes a new instance of Wadseeker.

Wadseeker::~Wadseeker (  ) 

Deallocates an instance of Wadseeker.

Member Function Documentation

void Wadseeker::abort (  ) 

Issues abort commands throughout entire library. aborted() signal is emitted when Wadseeker finishes aborting.

void Wadseeker::aborted (  )  [signal]

Emitted after abort() method is used and when it's safe to assume that Wadseeker finished all its jobs.

void Wadseeker::allDone (  )  [signal]

Emitted when Wadseeker finishes iterating through all files passed to seekWads() method. This signal is emitted regardless if all files were found or not. To check this use areAllFilesFound() method.

bool Wadseeker::areAllFilesFound (  )  const

true if all files that were passed to seekWads() method were found.

const QString Wadseeker::author (  )  [static]

author of the library.

const QString Wadseeker::defaultIdgamesUrl (  )  [static]

Default URL of Idgames archive, hardcoded into the library.

QStringList Wadseeker::defaultSitesListEncoded (  )  [static]

Runs content of defaultSites array through QUrl::toPercentEncoding() and returns a list of so encoded strings.

const QString Wadseeker::description (  )  [static]

description of the library.

void Wadseeker::downloadProgress ( int  done,
int  total 
) [signal]

Emits download progress. Programmer may use this to update a progress bar, for example.

done - bytes downloaded
total - size of file

const QStringList & Wadseeker::filesNotFound (  )  const

list of files that weren't found

bool Wadseeker::isIwad ( const QString &  wad  )  [static]

Attempts to detect if the input is an iwad.

wad Name of wad trying to be searched for.
True if the wad specified is an iwad.
See also:

void Wadseeker::message ( const QString &  msg,
Wadseeker::MessageType  type 
) [signal]

Emitted when Wadseeker wants to communicate about its progress with outside world.

msg - content of the message
type - See: Wadseeker::MessageType

void Wadseeker::messageSlot ( const QString &  msg,
int  type 
) [protected, slot]

This slot acts as a pipe to the message signal.

See also:

void Wadseeker::seekWads ( const QStringList &  wads  ) 

Library's "entry" method. This is where Wadseeker begins to iterate through WWW sites to find all files specified on the list.

wads - list of files that will be searched for

void Wadseeker::setCustomSite ( const QUrl &  url  ) 

Sets a custom site. This site has priority over all other sites and will be searched first. For example a link provided by the server can be passed here.

url - a valid, absolute URL

void Wadseeker::setPrimarySites ( const QStringList &  lst  ) 

Sets a list of primary sites. This is where Wadseeker begins it's search and where it returns to if nothing of interest was found on other pages.

lst - list of valid, absolute URLs

void Wadseeker::setPrimarySitesToDefault (  ) 

Convenience method. Sets list of primary sites to sites hardcoded into library itself.

See also:

void Wadseeker::setTargetDirectory ( const QString &  dir  ) 

Target directory is a directory where all seeked files will be saved.

void Wadseeker::setTimeConnectTimeout ( int  seconds  )  [static]

Sets time after which to abort connecting if no response is received.

seconds - time in seconds

void Wadseeker::setTimeDownloadTimeout ( int  seconds  )  [static]

Sets time after which to abort downloading if data stops coming.

seconds - time in seconds

void Wadseeker::setUseIdgames ( bool  use,
bool  highPriority = false,
QString  archiveURL = defaultIdgamesUrl() 

Sets parameters for Idgames protocol.

use - If true, idgames search will be performed. If false, idgames archive will be skipped.
highPriority - If true, idgames archive will be searched right after the custom site. If false, idgames archive will be searched after all other sites fail.
archiveURL - URL to Idgames search page

QString Wadseeker::targetDirectory (  )  const

Target directory is a directory where all seeked files will be saved.

const QString Wadseeker::version (  )  [static]

version string of the library.

QStringList Wadseeker::wantedFilenames ( const QString &  wad,
QString &  zip 
) [static, protected]

Returns the name of the actual files that will be searched for. For example, if somemod.wad was searched for, this would return somemod.wad and somemod.zip

wad Absolute file being searched for. (ex: somemod.wad)
[out] zip - returns name of according zip file

void Wadseeker::wwwAborted (  )  [protected, slot]

Activated when WWW class finishes aborting, emits aborted() signal.

See also:


const QString Wadseeker::yearSpan (  )  [static]

Development dates.

Member Data Documentation

const QString Wadseeker::defaultSites [static]

Initial value:

List of default sites to search for files.
See also:

const QString Wadseeker::iwadNames [static]

Initial value:

    "doom", "doom2", "heretic", "hexen", "tnt", "plutonia", "hexdd", "strife1", "voices", ""
List of file names that will be ignored as they are part of a commercial product. Empty string at the end of the array is required and indicates the end of the array.
See also:

The documentation for this class was generated from the following files: