本文整理汇总了C++中ThumbItem::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ ThumbItem::GetName方法的具体用法?C++ ThumbItem::GetName怎么用?C++ ThumbItem::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThumbItem
的用法示例。
在下文中一共展示了ThumbItem::GetName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoRename
void IconView::DoRename(QString folderName)
{
if (folderName.isEmpty() || folderName == "." || folderName == "..")
return;
ThumbItem *thumbitem = GetCurrentThumb();
if (!thumbitem)
return;
if (!GalleryUtil::Rename(m_currDir, thumbitem->GetName(), folderName))
{
QString msg;
if (thumbitem->IsDir())
msg = tr("Failed to rename folder");
else
msg = tr("Failed to rename file");
ShowOkPopup(msg, NULL, NULL);
return;
}
LoadDirectory(m_currDir);
}
示例2: HandleRename
void IconView::HandleRename(void)
{
ThumbItem *thumbitem = GetCurrentThumb();
if (!thumbitem)
return;
QString folderName = thumbitem->GetName();
QString message = tr("Rename");
MythTextInputDialog *dialog = new MythTextInputDialog(m_popupStack,
message, FilterNone, false, folderName);
if (dialog->Create())
m_popupStack->AddScreen(dialog);
connect(dialog, SIGNAL(haveResult(QString)),
SLOT(DoRename(QString)), Qt::QueuedConnection);
}
示例3: DoRename
void IconView::DoRename(QString folderName)
{
if (folderName.isEmpty() || folderName == "." || folderName == "..")
return;
ThumbItem *thumbitem = GetCurrentThumb();
int currPos = 0;
MythUIButtonListItem *item = m_imageList->GetItemCurrent();
if (item)
{
currPos = m_imageList->GetCurrentPos() + 1;
if (currPos >= m_imageList->GetCount())
currPos = m_imageList->GetCount() - 1;
}
if (!thumbitem)
return;
if (!GalleryUtil::Rename(m_currDir, thumbitem->GetName(), folderName))
{
QString msg;
if (thumbitem->IsDir())
msg = tr("Failed to rename folder");
else
msg = tr("Failed to rename file");
ShowOkPopup(msg, NULL, NULL);
return;
}
LoadDirectory(m_currDir);
m_imageList->SetItemCurrent(currPos);
}
示例4: LoadDirectory
bool GalleryUtil::LoadDirectory(ThumbList& itemList, const QString& dir,
const GalleryFilter& flt, bool recurse,
ThumbHash *itemHash, ThumbGenerator* thumbGen)
{
QString blah = dir;
QDir d(blah);
QString currDir = d.absolutePath();
QStringList splitFD;
bool isGallery;
QFileInfoList gList = d.entryInfoList(QStringList("serial*.dat"),
QDir::Files);
isGallery = (gList.count() != 0);
// Create .thumbcache dir if neccesary
if (thumbGen)
thumbGen->getThumbcacheDir(currDir);
QFileInfoList list = d.entryInfoList(GetMediaFilter(),
QDir::Files | QDir::AllDirs |
QDir::NoDotAndDotDot,
(QDir::SortFlag)flt.getSort());
if (list.isEmpty())
return false;
QFileInfoList::const_iterator it = list.begin();
const QFileInfo *fi;
if (thumbGen)
{
thumbGen->cancel();
thumbGen->setDirectory(currDir, isGallery);
}
if (!flt.getDirFilter().isEmpty())
{
splitFD = flt.getDirFilter().split(":");
}
while (it != list.end())
{
fi = &(*it);
++it;
// remove these already-resized pictures.
if (isGallery && (
(fi->fileName().indexOf(".thumb.") > 0) ||
(fi->fileName().indexOf(".sized.") > 0) ||
(fi->fileName().indexOf(".highlight.") > 0)))
continue;
// skip filtered directory
if (fi->isDir() &&
!splitFD.filter(fi->fileName(), Qt::CaseInsensitive).isEmpty())
continue;
if (fi->isDir() && recurse)
{
LoadDirectory(itemList, QDir::cleanPath(fi->absoluteFilePath()),
flt, true, itemHash, thumbGen);
}
else
{
if ((GalleryUtil::IsImage(fi->absoluteFilePath()) &&
flt.getTypeFilter() == kTypeFilterMoviesOnly) ||
(GalleryUtil::IsMovie(fi->absoluteFilePath()) &&
flt.getTypeFilter() == kTypeFilterImagesOnly))
continue;
ThumbItem *item = new ThumbItem(fi->fileName(),
QDir::cleanPath(fi->absoluteFilePath()), fi->isDir());
itemList.append(item);
if (itemHash)
itemHash->insert(item->GetName(), item);
if (thumbGen)
thumbGen->addFile(item->GetName());
}
}
return isGallery;
}
示例5: HandleShowDevices
void IconView::HandleShowDevices(void)
{
MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
#ifndef _WIN32
if (m_currDevice && mon && mon->ValidateAndLock(m_currDevice))
{
m_currDevice->disconnect(this);
mon->Unlock(m_currDevice);
}
else
m_currDir = m_galleryDir;
#endif
m_currDevice = NULL;
m_showDevices = true;
while (!m_itemList.isEmpty())
delete m_itemList.takeFirst();
m_itemHash.clear();
m_imageList->Reset();
m_thumbGen->cancel();
m_childCountThread->cancel();
// add gallery directory
ThumbItem *item = new ThumbItem("Gallery", m_galleryDir, true);
m_itemList.append(item);
m_itemHash.insert(item->GetName(), item);
if (mon)
{
MythMediaType type = MythMediaType(MEDIATYPE_DATA | MEDIATYPE_MGALLERY | MEDIATYPE_MVIDEO);
QList<MythMediaDevice*> removables = mon->GetMedias(type);
QList<MythMediaDevice*>::Iterator it = removables.begin();
for (; it != removables.end(); ++it)
{
if (mon->ValidateAndLock(*it))
{
item = new ThumbItem(
(*it)->getVolumeID().isEmpty() ?
(*it)->getDevicePath() : (*it)->getVolumeID(),
(*it)->getMountPath(), true, *it);
m_itemList.append(item);
m_itemHash.insert(item->GetName(), item);
mon->Unlock(*it);
}
}
}
ThumbItem *thumbitem;
for (int x = 0; x < m_itemList.size(); x++)
{
thumbitem = m_itemList.at(x);
thumbitem->InitCaption(m_showcaption);
MythUIButtonListItem* item =
new MythUIButtonListItem(m_imageList, thumbitem->GetCaption(), 0,
true, MythUIButtonListItem::NotChecked);
item->SetData(qVariantFromValue(thumbitem));
}
// exit from menu on show devices action..
SetFocusWidget(m_imageList);
}
示例6: LoadDirectory
bool GalleryUtil::LoadDirectory(ThumbList& itemList, const QString& dir,
int sortorder, bool recurse,
ThumbHash *itemHash, ThumbGenerator* thumbGen)
{
QString blah = dir;
QDir d(blah);
QString currDir = d.absolutePath();
bool isGallery;
QFileInfoList gList = d.entryInfoList(QStringList("serial*.dat"),
QDir::Files);
isGallery = (gList.count() != 0);
// Create .thumbcache dir if neccesary
if (thumbGen)
thumbGen->getThumbcacheDir(currDir);
QFileInfoList list = d.entryInfoList(GetMediaFilter(),
QDir::Files | QDir::AllDirs,
(QDir::SortFlag)sortorder);
if (list.isEmpty())
return false;
QFileInfoList::const_iterator it = list.begin();
const QFileInfo *fi;
if (thumbGen)
{
thumbGen->cancel();
thumbGen->setDirectory(currDir, isGallery);
}
while (it != list.end())
{
fi = &(*it);
++it;
if (fi->fileName() == "." || fi->fileName() == "..")
continue;
// remove these already-resized pictures.
if (isGallery && (
(fi->fileName().indexOf(".thumb.") > 0) ||
(fi->fileName().indexOf(".sized.") > 0) ||
(fi->fileName().indexOf(".highlight.") > 0)))
continue;
if (fi->isDir() && recurse)
{
GalleryUtil::LoadDirectory(
itemList, QDir::cleanPath(fi->absoluteFilePath()),
sortorder, true, itemHash, thumbGen);
}
else
{
ThumbItem *item = new ThumbItem(
fi->fileName(),
QDir::cleanPath(fi->absoluteFilePath()), fi->isDir());
itemList.append(item);
if (itemHash)
itemHash->insert(item->GetName(), item);
if (thumbGen)
thumbGen->addFile(item->GetName());
}
}
return isGallery;
}