Example #1
0
void Desk::addFile (File *f)
   {
   // set position and add to list
   f->setPos (_pos);
   _files << f;

   // we now have a dirty desk
   dirty ();

   // advance pos
   advanceOne ();

   // update our row count
   updateRowCount ();
   }
Example #2
0
void Desk::addMatches (const QString &dirPath, const QString &match,
               bool subdirs, Operation *op)
   {
   int upto = 0;

   QDir dir (dirPath);

   // don't write back the maxdesk.ini file if we are just selecting some
   if (match.length () > 0 || subdirs)
      _do_writeDesk = false;

//   printf ("dir = %s\n", dirPath.latin1 ());
   dir.setFilter( (QDir::Filter)((subdirs ? QDir::Dirs : 0) | QDir::Files | QDir::NoSymLinks ));
   dir.setSorting( QDir::Name);

   const QFileInfoList list = dir.entryInfoList();
   if (!list.size ())
      {
      printf ("dir not found\n");
      return;
      }

   if (op)
      op->setCount (list.size ());
   for (int i = 0; i < list.size (); i++)
      {
      QFileInfo fi = list.at (i);
      if (op)
         op->setProgress (upto++);

      if (fi.isDir ())
         {
         if (fi.fileName () != "." && fi.fileName () != "..")
            addMatches (dirPath + fi.fileName () + "/", match, subdirs, 0);
         }
      else if (match == QString::null || fi.fileName ().contains (match, false))
         addFile (fi, dirPath);
      }
   updateRowCount ();
   }
Example #3
0
Desk::Desk (const QString &dirPath, const QString &trashPath,
   bool do_readDesk, bool read_sizes, bool writeDesk)
   {
   //qDebug () << "new Desk" << dirPath << -90 % 360;
   setup ();
   _do_writeDesk = writeDesk;
   _dir = dirPath;
   _rootDir = trashPath;
   if (!_dir.isEmpty ())
      Q_ASSERT (_dir.right (1) == "/");

   if (!trashPath.isEmpty ())
      {
      QDir dir;
      _trash_dir = trashPath + ".maxview-trash";
      if (!dir.exists (_trash_dir))
         dir.mkdir (_trash_dir);
      }

   // read in any maxdesk file
   if (do_readDesk)
      readDesk (read_sizes);
   updateRowCount ();
   }
Example #4
0
void Table::resetCellSize()
{
	m_cellSize = QSize();
	updateRowCount();
}