Ticket #5792: 5792-v2.patch
File 5792-v2.patch, 1.7 KB (added by , 16 years ago) |
---|
-
libs/libmyth/mythmedia.cpp
62 62 m_Status = MEDIASTAT_UNKNOWN; 63 63 m_MediaType = MEDIATYPE_UNKNOWN; 64 64 65 QFileInfo fi(DevicePath); 66 if (fi.isSymLink()) 67 m_RealDevice = m_DevicePath.section('/', 0, -2) + "/" + fi.readLink(); 68 else 69 m_RealDevice = QString::null; 65 m_RealDevice = QString::null; 66 67 QFileInfo fi(m_DevicePath); 68 QString link = QString:: null; 69 for (uint i = 0; (i < 256) && fi.isSymLink() && 70 !(link = fi.readLink()).isEmpty(); i++) 71 { 72 if (link[0] == '/') // absolute link 73 m_RealDevice = link; 74 else // relative link.. 75 m_RealDevice = fi.absoluteDir().absolutePath() + "/" + link; 76 fi = QFileInfo(m_RealDevice); 77 } 70 78 } 71 79 72 80 bool MythMediaDevice::openDevice() … … 378 386 QString link = QString::null; 379 387 380 388 // If the device name in the mounts file is a symlink, follow it.. 381 if (fi.isSymLink() && !(link = fi.readLink()).isEmpty()) 389 for (uint i = 0; (i < 256) && fi.isSymLink() && 390 !(link = fi.readLink()).isEmpty(); i++) 382 391 { 383 392 if (link[0] == '/') // absolute link 384 393 deviceNames.push_back(link); 385 394 else // relative link.. 386 deviceNames.push_back(fi.absoluteDir().absolutePath() 387 + "/" + link); 395 { 396 deviceNames.push_back( 397 fi.absoluteDir().absolutePath() + "/" + link); 398 } 399 fi = QFileInfo(deviceNames.back()); 388 400 } 389 401 390 402