/*
 * Bookmark.cpp
 *
 * (c) 2002 by Thorsten Scheuermann <tscheuermann@gmx.net>
 *
 * This program 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 2 of the License, or
 * (at your option) any later version.
 */

#include "Bookmark.h"
#include <qfile.h>

QString Bookmark::rootDir[3] = { "/mnt/cf", "/mnt/card", "" };

Bookmark::Bookmark()
{
  theStorage = STORAGE_CF;
}

Bookmark::~Bookmark()
{
}

void Bookmark::setName(const QString& name)
{
  theName = name;
}

void Bookmark::setDirectory(const QString& dir)
{
  theDir = dir;
}

QString Bookmark::fullPath() const
{
  QString fp = rootDir[theStorage];
  
  if(theDir[0] != '/')
    fp += '/';
  fp += theDir;

  return fp;
}

bool Bookmark::available() const
{
  return QFile::exists(fullPath());
}

void Bookmark::setStorage(enum StorageType st)
{
  theStorage = st;
}
